Hello, I invoked my application using : java -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration application_class
I used 'org.apache.xerces.parsers.XIncludeParserConfiguration' as the parser configuration. But still I am not able to retreive the value of the embedded XML. The parent.xml is : <?xml version='1.0'?> <document xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="file:///H:/ProjectAutomation/Release-1.0-Sept-3-2003/PreReq-Jars/xerces-2_5_0/child.xml"/> </document> where child.xml is : <?xml version="1.0"?> <child> <test>hi</test> <test>hello</test> </child> When I parse parent.xml using DOMParser, the elements of child.xml are NOT printed. The last node that gets printed is 'xi:include'. I wonder what is going wrong? Please help. Thank you. Prapti -----Original Message----- From: Michael Glavassevich [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 6:17 PM To: [EMAIL PROTECTED] Subject: RE: XInclude Hello Prapti, Try setting the system property to org.apache.xerces.parsers.XIncludeParserConfiguration. This is the qualified name of the XMLParserConfiguration. In your notation, you would want to invoke your application like so: java -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration application_class On Mon, 6 Oct 2003, Prapti Sen wrote: > Hello, > I am overriding the default parser configuration for enabling XInclude > processing using: > > java -Dorg.apache.xerces.xni.parser.XMLParserConfiguration= > org.apache.xerces.xni.parser.org.apache.xerces.parsers.XIncludeParserConfiguration > application_class > > I have set the CLASSPATH for "xercesImpl.jar" (xercesImpl.jar contains > 'org.apache.xerces.xni.parser.XMLParserConfiguration' and > 'org.apache.xerces.xni.parser.org.apache.xerces.parsers.XIncludeParserConfiguration' > ) . > > But still 'org.apache.xerces.xni.parser.XMLParserConfiguration' is not > getting set to > 'org.apache.xerces.xni.parser.org.apache.xerces.parsers.XIncludeParserConfiguration'. > > Because the output of running : > > $ java application_class > > is the same as running > > $ java -Dorg.apache.xerces.xni.parser.XMLParserConfiguration= > org.apache.xerces.xni.parser.org.apache.xerces.parsers.XIncludeParserConfiguration > application_class > > I think the 'org.apache.xerces.xni.parser.XMLParserConfiguration' is not > getting its new value. Do I need to configure something else for the new > setting to take effect. > > Thank you. > Prapti > > > -----Original Message----- > From: Michael Glavassevich [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 02, 2003 12:53 PM > To: [EMAIL PROTECTED] > Subject: Re: XInclude > > > Hi, > > In order to use XInclude in Xerces you need to override the default parser > configuration. It must be set to > org.apache.xerces.parsers.XIncludeParserConfiguration. There are a couple > ways of doing this. They're described in the FAQ [1]. > > Hope that helps. > > [1] http://xml.apache.org/xerces2-j/faq-xni.html#override-default-config > > On Thu, 2 Oct 2003, Prapti Sen wrote: > > > I have Xercer-2.5.0 . I am not sure how to use XInclude. > > When I parse the Test_Suite.xml I do not get the contents of the included > > test.xml. Someone please help. > > > > I am using XInclude in a XML file (Test_Suite.xml) . The contents of > > Test_Suite.xml are: > > > > > > Test_Suite.xml > > ---------------------- > > <?xml version="1.0"?> > > <Test_Suite> > > <foo xmlns:xi="http://www.w3.org/2001/XInclude"> > > <xi:include href="test.xml"/> > > <test>some</test> > > </foo> > > </Test_Suite> > > > > > > test.xml > > ------------ > > <?xml version="1.0"?> > > <test> > > <test1>hi</test1> > > <test2>hello</test2> > > </test> > > > > > > As far as I understand, the resultant Test_Suite.xml, after resolving > > inclusions, actually has the following contents: > > > > <?xml version="1.0"?> > > <Test_Suite> > > <foo xmlns:xi="http://www.w3.org/2001/XInclude"> > > <test> > > <test1>hi</test1> > > <test2>hello</test2> > > </test> > > <test>some</test> > > </foo> > > </Test_Suite> > > > > > > But on parsing Test_Suite.xml , it does not give me the contents of > > test.xml. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- -------------------- Michael Glavassevich [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
