This Version: August 6, 2001
Latest Version: http://simonstl.com/ns/namespaces/elements/lastContext/
Previous Version: None
Editors:
This vocabulary contains a single attribute, an:lastNSContext, generated by a filter, com.simonstl.namespace.elements.ElementAnnotNamespaceFilter, which annotates unqualified descendant elements of qualified elements with information about their ancestor's namespace. It is a less intrusive approach than the forced-qualification approach. It is also more easily reversed or ignored if necessary.
Given a document:
<p:person xmlns:p="http://simonstl.com/person"> <givenName>Chip</givenName> <familyName>Skillet</familyName> <address> <z:street xmlns:z="http://simonstl.com/address">1259 Zingzang Road</z:street> <city>Ithaca</city> </address> </p:person>
and a rules file which specifies annotation for only the http://simonstl.com/person namespace:
<namespaces xmlns="http://simonstl.com/ns/namespaces/elements/annotate/"> <include nsURI="http://simonstl.com/person" /> </namespaces>
the com.simonstl.namespace.elements.ElementAnnotNamespaceFilter will produce:
C:\opensrc\namespace>java com.simonstl.namespace.elements.ElementAnnotFilterTester annotEl1.xml test2.xml <?xml version="1.0" standalone="yes"?> <p:person xmlns:p="http://simonstl.com/person"> <givenName an:lastNSContext="http://simonstl.com/person" xmlns:an="http://simonstl.com/ns/namespaces/elements/lastContext/">Chip</givenName> <familyName an:lastNSContext="http://simonstl.com/person" xmlns:an="http://simonstl.com/ns/namespaces/elements/lastContext/">Skillet</familyName> <address an:lastNSContext="http://simonstl.com/person" xmlns:an="http://simonstl.com/ns/namespaces/elements/lastContext/"> <z:street xmlns:z="http://simonstl.com/address">1259 Zingzang Road</z:street> <city an:lastNSContext="http://simonstl.com/person">Ithaca</city> </address> </p:person>
The an:lastNSContextattribute identifies the namespace of the first qualified ancestor element.