Yegor,
I've attached to the bug
https://issues.apache.org/bugzilla/show_bug.cgi?id=47468
I've tried your code snippet but it didn't work since the selection
result is empty. I don't know if this is because the xpath is not
correct or because the bean doesn't support the access to that path.
I managed to get the DOM Node of the root of the XML Schema with this:
Node xmlSchema = ctSchema.getDomNode().getFirstChild();
where ctSchema is an instance of CTSchema.
I can manage to work with the DOM Node so for me this isn't a blocking
bug.
Thank you for your support.
Regards,
Roberto
Il giorno 02/lug/09, alle ore 14:36, Yegor Kozlov ha scritto:
Roberto,
I think it should be accessible via XmlCursor, something like as
follows:
XmlCursor c = parent.newCursor();
c.selectPath("./sequence/any");
while (c.toNextSelection()) {
XmlObject o = c.getObject();
//
}
where parent is an instance of CT_Schema.
Do you have a sample OOXML file containing Custom XML Mapping
schema? Can you post it in Bugzilla?
Regards,
Yegor
Hi,
to use the Custom XML Mapping an XML Schema is saved in the .xlsx
file. I would like to access to this schema using the ooxml-schema
API but I can't find any useful accessor method.
An example of the xml where the schema is saved is the following:
<MapInfo>
<Schema ID="Schema1" >
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="">
...
</xsd:schema>
</Schema>
...
</MapInfo>
The Schema element is of complex type CT_Schema
<complexType name="CT_Schema">
<sequence>
<any/>
</sequence>
<attribute name="ID" type="xsd:string" use="required"/>
<attribute name="SchemaRef" type="xsd:string" use="optional"/>
<attribute name="Namespace" type="xsd:string" use="optional"/>
</complexType>
so to access to the schema I need to navigate the <any/> part of
the xml.
The complex type CT_Schema is mapped to the class CTSchema which
has only the getID(),getNamsepace() and getSchemaRef() methods and
there is no way to access to the <any/> part of the xml.
According to this (http://xmlbeans.apache.org/docs/2.0.0/guide/conHandlingAny.html
) there should be also a getArrayofany() method. I think there must
be an option to tell XMLBeans to generate the accessor method also
for the <any/> node.
Have you any clue on how to enable this?
Thanks,
Roberto
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
Roberto Manicardi
=
=
=
========================================================================
http://www.jugroma.it
http://roma.javaday.it
JUG Roma Coordinator