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:


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:

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


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

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

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 thoughts on “Flare and Schemas (part 1)

  1. Rachael

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

    Reply
    1. Thomas Tregner Post author

      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!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

HTML tags are not allowed.

199,198 Spambots Blocked by Simple Comments