On Sun, 13 Dec 2009, Michael Ludwig wrote:
Vincent Herrmann schrieb am 13.12.2009 um 15:09:07 (+0100):
XSAttributeDeclaration attr = attrUse.getAttrDeclaration() ;
System.out.println(attr.getName) ;
My code print attribute's name but I want attribute's ref. How must I
do to get it?
org.apache.xerces.xs.XSAttributeDeclaration#getName - inherited from
org.apache.xerces.xs.XSObject#getName - which is defined as:
The name of type NCName, as defined in XML Namespaces [...]
An NCName is a non-colonized name, so it is only the local part, without
the namespace. What you want is the so-called QName, the qualified name.
There is no method to get the QName, which probably makes sense. Beware
that QNames are always dependent on the in-scope namespaces, so they
cannot always simply be extracted and transplanted.
Xerces' XML Schema API very closely models the schema components defined
by the schema specification. The prefixes which were part of the schema
documents that composed it are not part of this model and are not made
available through the API.
Take a look at the following two methods, one of them might offer what
you want:
org.apache.xerces.xs.XSAttributeDeclaration#getNamespace
org.apache.xerces.xs.XSAttributeDeclaration#getNamespaceItem
--
Michael Ludwig
---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org
---------------------------
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org