Reputation: 3860
I have several XML styled documents and I have a XSD file that contains the documentation for some tags.
I want to link some of the docs out of the XSD to some elements in the XML.
The XSD documentation is for example: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/config.xsd?view=markup => element rtmphostlocal
Now I have an XML document for example here: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/mainAttributes.lzx?view=markup
There is an attribute:
<attribute name="rtmphostlocal" value="" type="string" />
I would like to link the XSD documentation from the element rtmphostlocal in the comment area of the other XML document. So that there is only a single source of docs to edit and I don't have to duplicate the comments everywhere I use the attribute. Kind of JavaDoc style.
How can I achieve that?
Is there some notation like in HTML with #anchors to link some element out of an XSD?
Upvotes: 1
Views: 734
Reputation: 25034
You want to be able to point from another document to the element declaration for rtmphostlocal
in the schema document you show? It's an XML document; give the element declaration an ID, and point to it. The element declaration might look like this:
<xs:element name="rtmphostlocal" id="elem_rtmphostlocal">
...
</xs:element>
Some people might prefer to use xml:id="..."
instead of id="..."
.
Whether the systems that read the link pointing into the document will be able to do anything useful with it depends mostly on whether they support XML fragment identifiers as specified in the XPointer spec. But you didn't ask for software that supports XPointer, you asked for a notation. Answer: yes, there's a notation. Use IDs.
Upvotes: 1