Inserting an XML element into an XML doc, issue with default namespace

2009-10-05 Thread Pascal Maugeri
Hi I've wrote the following helper method to create or replace an XML element into an XML document (this may help others). I notice that I must specify the default namespace into my XML element (elt parameter below), otherwise when the element is inserted xmlbeans add a default one with no value

Empty XML namespace inserted when using XmlCursor.copyXml()

2008-06-18 Thread Pascal Maugeri
Hi I'm using XmlCursor.copyXml() to insert an element within a XML document. The element is inserted at the right place but contains an empty namespace: eg. display-name *xmlns=*Hola/display-name What should I do in order to not have this empty namespace definition in the result ? Regards,

Re: Having issues with WS-Security document construction :S

2008-05-22 Thread Pascal Maugeri
Could you play with something like this: XmlOptions opts = new XmlOptions(); opts.setSavePrettyPrint(); final MapString,String suggestedNamespaces = new HashMapString,String(); suggestedNamespaces.put( http://schemas.xmlsoap.org/ws/2002/12/secext;, );

Re: Schema compilation into XMLBeans classes - issue with several xs:anyType children

2008-05-22 Thread Pascal Maugeri
*To:* user@xmlbeans.apache.org *Subject:* RE: Schema compilation into XMLBeans classes - issue with several xs:anyType children No, this is exactly what I had in mind :-) Radu -- *From:* Pascal Maugeri [mailto:[EMAIL PROTECTED] *Sent:* Monday, May 19, 2008 3:28 AM

Re: Schema compilation into XMLBeans classes - issue with several xs:anyType children

2008-05-19 Thread Pascal Maugeri
the content or you need to build the content from scratch, respectively). Radu -- *From:* Pascal Maugeri [mailto:[EMAIL PROTECTED] *Sent:* Thursday, May 15, 2008 5:15 AM *To:* user@xmlbeans.apache.org *Subject:* Schema compilation into XMLBeans classes - issue

Schema compilation into XMLBeans classes - issue with several xs:anyType children

2008-05-15 Thread Pascal Maugeri
Hi This email is related to the compilation of XMLBeans classes corresponding to the XML schema urn:ietf:params:xml:ns:common-policy as defined in RFC 4745, section 13. I give the reference to this specific schema to illustrate but of course the issue should apply in other situation as well. In

Re: Parsing an XML fragment

2008-05-01 Thread Pascal Maugeri
you have elementFormDefault=qualified. So this means your doc fragment has to look like: String xml = ns:element uri=\www.apache.org\ xmlns:ns= \http://www.example.org/docelement\http://www.example.org/docelement%5C /; Radu On Wed, 2008-04-30 at 15:07 +0200, Pascal Maugeri wrote: Hi Radu

Re: Parsing an XML fragment

2008-04-30 Thread Pascal Maugeri
constraints that force you to parse from Element level? HTH Jim On Mon, Apr 28, 2008 at 6:17 AM, Pascal Maugeri [EMAIL PROTECTED] wrote: Radu You're right in the example below the element is not a global schema type. So what should I do if a server (XCAP server) sends

Basic question about parsing with XmlCursor

2008-04-03 Thread Pascal Maugeri
Hi I do not manage to obtain the same results described in the XmlCursor javadoc ( http://xmlbeans.apache.org/docs/2.0.0/reference/org/apache/xmlbeans/XmlCursor.html) when analyzing the sample XML file. According to the javadoc I should get: sample x='y' valuefoo/value /sample STARTDOC

Re: Basic question about parsing with XmlCursor

2008-04-03 Thread Pascal Maugeri
On Thu, 2008-04-03 at 21:09 +0200, Pascal Maugeri wrote: Hi I do not manage to obtain the same results described in the XmlCursor javadoc ( http://xmlbeans.apache.org/docs/2.0.0/reference/org/apache/xmlbeans/XmlCursor.html) when analyzing the sample XML file. According to the javadoc I

How to insert a new child under an XML element that has no child (simple (stupid) XmlCursor question)

2008-03-04 Thread Pascal Maugeri
Hi I have the following document: a b c/ /b /a When I move my XmlCursor to b child (in this case c/) and add a new child d/ with cursor.beginElement() I get a the correct result: a b d/ c/ /b /a But now if the original document is (no child under b/ yet): a b/ /a How

Re: Applying XPath to an XML with or without namespace

2008-02-25 Thread Pascal Maugeri
is that the path must follow the structure of the document. If elements/attributes are namespace-qualified in the document, then they must be too in the path. - Wing Yew From: Pascal Maugeri [mailto:[EMAIL PROTECTED] Sent: Friday, February 22, 2008 8:40

Re: Applying XPath to an XML with or without namespace

2008-02-25 Thread Pascal Maugeri
'mynamespace; /a/b. The bottom line is that the path must follow the structure of the document. If elements/attributes are namespace-qualified in the document, then they must be too in the path. - Wing Yew -- *From:* Pascal Maugeri [mailto:[EMAIL PROTECTED] *Sent:* Friday

Re: How to apply an xpath query to a document ?

2008-02-22 Thread Pascal Maugeri
distribution. This already applies to XMLBeans 2.2 and the version of Saxon (8.6.1) supported by it. This information appears on the XMLBeans home page too. - Wing Yew -- *From:* Pascal Maugeri [mailto:[EMAIL PROTECTED] *Sent:* Thursday, February 14, 2008 2:58 AM

Applying XPath to an XML with or without namespace

2008-02-22 Thread Pascal Maugeri
Hi I would like to have some clarifications on how to apply XPath query on a XML document depending if it comes with or without a namespace definition. When I run the following code executing the XPath query /a/b on a document with no namespace: String doc = ab//a; String query

Re: How to apply an xpath query to a document ?

2008-02-13 Thread Pascal Maugeri
for your help Pascal On Feb 10, 2008 8:27 PM, Jacob Danner [EMAIL PROTECTED] wrote: Take a peek at http://xmlbeans.apache.org/samples/XQueryXPath.html -jacobd On Feb 10, 2008 7:56 AM, Pascal Maugeri [EMAIL PROTECTED] wrote: Hi I need to do this simple operation: having a XML

How to apply an xpath query to a document ?

2008-02-10 Thread Pascal Maugeri
Hi I need to do this simple operation: having a XML document (as a String for instance) I want to apply to it an XPath query and to get the XML fragment result in a new String. Could you give me some source code sample or a link ? Thanks in advance Pascal