Thanks for pointing out the errors, but it still does not work after correcting the errors. I also added a test node to the app.xml to test if other noded could be used and I am able to use non-Entity tag nodes. Now my xml files look like:
common.xml <?xml version="1.0" encoding="UTF-8"?> <element name="CommonProperty"> <property name="member1">bold</property> <property name="member2">28</property> </element> app.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configuration [ <!ENTITY common SYSTEM "./common.xml"> ]> <Configuration> <Component name="CommonProp"> &common; </Component> <test>Madhu</test> </Configuration> This Xpath works: /Configuration/test/text() This does not :-( /Configuration/Component/element/property[1]/text() Thanks, - Madhu On 4/20/07, Alberto Massari <[EMAIL PROTECTED]> wrote:
Hi Madhu, I think you have two errors here: 1) the common.xml must also have an encoding declaration, or have its XML PI removed altogether 2) the DOCTYPE in the app.xml must specify the root element, i.e. 'Configuration' instead of 'common' Alberto At 10.57 20/04/2007 +0530, Madhu Lagu wrote: >Hi All, > >I am stuck with this for long. Any help is greatly appreciated. > >Thanks, >- Madhu > >On 4/16/07, Madhu Lagu <[EMAIL PROTECTED]> wrote: >>Hi All, >> >>Me and my friend have beenusing xerces and xalan to read xml files. We have >>some commonly used files which we would like to include in other xml files >>using ENTITY tags. >>We could not find a way in which to use ENTITY tags in this way. Any >>pointers will be hightly appreciated. I am giving a small sample of what >> >>common.xml >><?xml version="1.0"?> >><element name="CommonProperty"> >> <property name="member1">bold</tauproperty> >> <property name="member2">28</tauproperty> >></element> >> >>app.xml >><?xml version="1.0"?> >><!DOCTYPE common [ <!ENTITY common SYSTEM "common.xml"> ]> >> >><Configuration> >> <Component name="CommonProp"> >> &common; >> </Component> >></Configuration> >> >>I want to be able to use a XPATH like >>"/Configuration/Component/element/property[1]/text()" to >>read the value "bold" from app.xml >> >>Thanks, >>- Madhu >> > > >-- >- Madhu >Cell: +91-98499-92972
-- - Madhu Cell: +91-98499-92972
