You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Horvath Peter, dr." <dr...@freemail.hu> on 2004/12/17 09:11:45 UTC
How can I get non standard additional info from schema
Hi everybody,
My problem is:
How can I get some additional, non standard information from the XSD file?
I try to explain:
my XSD file contains some additional attributes in a different namespace:
e.g.:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
xmlns:foo="http://www.foo.xx/foo/foo">
<xs:element name="xyz" type="xyz-type" foo:attr1="...." foo:attr2="..."
/>
<xs:complexType name="xyz-type" foo:attr="...">
....
<xs:attribute name="name" type="xs:Name" foo:attr="...."/>
...
</xs:complexType>
I load the XSD file on a usual manner:
XmlObject[] xmlObjects = new XmlObject[] { XmlObject.Factory.parse(
fileSchema ) };
schemaTypeSystem = XmlBeans.compileXsd( xmlObjects,
XmlBeans.getBuiltinTypeSystem(), null );
schemaTypeLoader = XmlBeans.typeLoaderUnion( new SchemaTypeLoader[] {
schemaTypeSystem,
XmlBeans.getBuiltinTypeSystem()
});
From the root point of schemaTypeSystem I have not found any method to get
values of 'foo' attributes.
From the root point of xmlObjects using the XmpPath possibility I can get
the needed info:
String sPath = "declare namespace z="http://www.foo.xx/foo/foo'
.//xyz-type/@z:attr";
XmlObject[] xmlObjectAttrs = xmlObjects[0].selectPath(sPath);
String sValue = (XmlAnyTypeImpl)xmlObjectAttrs[0]).getStringValue();
But I don't know, how can I bind a SchemaType objects of schemaTypeSystem
and the corresponding xmlObject derived from the loaded XSD file.
I can not compile the schema file, because in the real environment I have
to
use an accidentally loaded XSD file.
I there any solution for my problem?
Thank you in anticipation
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org