Flare and Schemas (part 1)

XSD is a schema language for XML. The World Wide Web Consortium (W3C) published XML Schema Part 1: Structures Second Edition and XML Schema Part 2: Datatypes Second Edition as recommendations in 2004. W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures and W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes were published as recommendations in 2012. The W3C recommendations are posted at:

http://www.w3.org/TR/xmlschema-1/

http://www.w3.org/TR/xmlschema-2/

http://www.w3.org/TR/xmlschema11-1/

http://www.w3.org/TR/xmlschema11-2/

An XML Schema Document declares what is an acceptable structure for an XML document which references the schema. Take a look at this fragment of the XML from the XML source for the topic you are reading:

<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd"
...

At the time of writing, when the URI value in the string for the xmlns:MadCap namespace attribute is placed in a web browser as the URL, the website for MadCap Software shows a Page Not Found message. The URI looks like a web page URL and it could be. Sometimes the authors of schemas post copies of their schemas at the URL which matches the URI. But that is not the primary function of the URI. Rather, the idea is to ensure uniqueness. MadCap Software knows that http://www.madcapsoftware.com/Schemas/MadCap.xsd can only belong to MadCap Software. This minimizes the chance that some other schema author will use the same URI.

But MadCap Flare does use a copy of the schema identified by http://www.madcapsoftware.com/Schemas/MadCap.xsd to validate the XML files which reference it. Look in the Schemas folder for your Flare installation:

C:\Program Files (x86)\MadCap Software\MadCap Flare V8\Flare.app\Resources\Schemas

In the Schemas folder there is a file called MadCap.xsd which begins this way:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.madcapsoftware.com/MadCap.xsd" 
	elementFormDefault="qualified" 
	xmlns="http://www.w3.org/2001/XMLSchema" 
	xmlns:MadCap="http://www.madcapsoftware.com/MadCap.xsd" 
	xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<simpleType name="conditions" >		<!-- -fix- semicolon separated list-->
		<restriction base="string">
		</restriction>
	</simpleType>
...

As you browse through the schema, you will see Flare-centric items. For example:

  <xs:element name="xref">
    	</xs:element>

When you insert a cross-reference in a Flare document, the element may look like this in the Text Editor:

<MadCap:xref href="Flare API.htm">See "Flare API" on page 1</MadCap:xref>

The element name, xref, is qualified with the schema name, MadCap. In the opening fragment of MadCap.xsd you can see the attribute for the xs: schema element which declares the schema to require qualified elements. Were you to remove the MadCap qualifier from the name, the Flare topic would not validate against MadCap.xsd.

Knowing where the schema is comes in handy if you want to validate a Flare topic against the schema outside of the Flare interface.

2 comments

  1. Is it possible to attach another schema in order to create form fields for a pdf document?
    Thanks

    1. I’ve not considered that. I don’t think their PDF builder would handle that. But I don’t want to rule it out. I’ll forward your question to some people. Thanks for reading!

Leave a comment

Your email address will not be published.

HTML tags are not allowed.

253,914 Spambots Blocked by Simple Comments