xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javier Ramos" <ra...@parsec.es>
Subject Re: how to deal with extensible schemas
Date Mon, 10 Nov 2003 20:10:58 GMT
Hi,

    I am still trying to copy a document inside a placeholder in an
extensible schema. Usage of cursors semms to be the solution, as pointed out
by Yogesh.

But now I face another problem: if I try to copy a whole document, instead
of a document fragment, I get an exception ( IllegalArgumentException )
telling me that the operation cannot be carried out for a whole document.

Is there a way around this??

Javier


----- Original Message ----- 
From: "Yogesh L. Simmhan" <ysimmhan@cs.indiana.edu>
To: <xmlbeans-user@xml.apache.org>
Sent: Monday, November 10, 2003 5:24 PM
Subject: RE: how to deal with extensible schemas


> You can create an XmlCursor for the XmlObject you wish to insert and to
the
> Container and use the copyXml method in the cursor.
>
> e.g. to insert 'child' XmlObject in container,
>
>         XmlCursor cursorTo = container.newCursor();
>         cursorTo.toNextToken();
>
>         XmlCursor cursorFrom = child.newCursor();
>         cursorFrom.copyXml(cursorTo);
>
>         cursorFrom.dispose();
>         cursorTo.dispose();
>
> --Yogesh
>
> ________________________________________
> From: Javier Ramos [mailto:ramos@parsec.es]
> Sent: Monday, November 10, 2003 5:50 AM
> To: xmlbeans-user@xml.apache.org
> Subject: how to deal with extensible schemas
>
> Hi,
>
> I am trying to figure out how to deal with extensible schemas. What want
is
> to have the possibility to use xs:any element to declare that any xml
content
> can be hooked under a given element. If I create a schema like:
>
> <xs:complexType name="container">
> <xs:sequence>
> <xs:any minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
>
> when I use scomp to generate java code and classes I obtain a dummy class
> for the element type 'container' and can find no way to hook any XMLObject
> inside it.
>
> In XMLCursor I can see there are methods to insert single elements or
> attributes, but no way to insert a whole XMLObject contents under a given
cursor
> position.
> In XMLObject I cannot find nothing of help.
>
> Does anybody have any ideas?
>
> Javier
>
>
>
>
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
>



- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message