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.

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


Reply via email to