You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Reuven Nisser <10...@compuserve.com> on 2006/04/11 20:04:05 UTC

Using XERCES with XPath support

Hello,

I have an application relying heavily on XML. I am currently using MS-XML4.

The application imports, builds, changes and exports XML documents and 
uses XPATH to find notes. The main reason for switching to XERCES is 
using Apache XML Security later.


I am trying to migrate the application, I started with XERCES and then 
found out it has no XPATH support. I continued with XALAN but it does 
not allow to change the XML and if I use a wrapper I will need to 
rebuild it after each XML change.


Do, where do I go from here? Is it possible to use Apache XML Security 
with other XML libraries? Especially with MS-XML 4?


Thanks,

Reuven Nisser


Re: Using XERCES with XPath support

Posted by Reuven Nisser <10...@compuserve.com>.
Hello,

The problem is that I am using the document for multiple finds and 
multiple changes all the time. If I will need to re-wrap after each 
change, the performance will be terrible.

Maybe the solution will be to stay with MS-XML4 and write a wrapper for 
xml-security? What do you think?

Thanks, Reuven


Berin Lautenbach wrote:
>  
> Yes - if you want XPath you need to use the Xalan library.
>
> The Xalan DOM cab be a wrapper around the Xerces DOM - which means you
> can use XPath to find what you want in the DOM and then map the Xalan
> node back to a Xerces node that allows you to then change the DOM.  (At
> that point you need to re-wrap the Xalan DOM, but generally it's passed
> its use by then anyway).
>
> There are some examples in the Xalan site, and there is some code in the
> xml-security library that calls on Xalan for some of the transformations
> that might provide some pointers as well.  Have a look at the
> txfmxpath.cpp file.
>
> Cheers,
> 	Berin
>
> Reuven Nisser wrote:
>   
>> Hello,
>>
>> I have an application relying heavily on XML. I am currently using MS-XML4.
>>
>> The application imports, builds, changes and exports XML documents and
>> uses XPATH to find notes. The main reason for switching to XERCES is
>> using Apache XML Security later.
>>
>>
>> I am trying to migrate the application, I started with XERCES and then
>> found out it has no XPATH support. I continued with XALAN but it does
>> not allow to change the XML and if I use a wrapper I will need to
>> rebuild it after each XML change.
>>
>>
>> Do, where do I go from here? Is it possible to use Apache XML Security
>> with other XML libraries? Especially with MS-XML 4?
>>
>>
>> Thanks,
>>
>> Reuven Nisser
>>
>>     
>
>
>   

Re: Using XERCES with XPath support

Posted by Berin Lautenbach <be...@wingsofhermes.org>.
Yes - if you want XPath you need to use the Xalan library.

The Xalan DOM cab be a wrapper around the Xerces DOM - which means you
can use XPath to find what you want in the DOM and then map the Xalan
node back to a Xerces node that allows you to then change the DOM.  (At
that point you need to re-wrap the Xalan DOM, but generally it's passed
its use by then anyway).

There are some examples in the Xalan site, and there is some code in the
xml-security library that calls on Xalan for some of the transformations
that might provide some pointers as well.  Have a look at the
txfmxpath.cpp file.

Cheers,
	Berin

Reuven Nisser wrote:
> Hello,
> 
> I have an application relying heavily on XML. I am currently using MS-XML4.
> 
> The application imports, builds, changes and exports XML documents and
> uses XPATH to find notes. The main reason for switching to XERCES is
> using Apache XML Security later.
> 
> 
> I am trying to migrate the application, I started with XERCES and then
> found out it has no XPATH support. I continued with XALAN but it does
> not allow to change the XML and if I use a wrapper I will need to
> rebuild it after each XML change.
> 
> 
> Do, where do I go from here? Is it possible to use Apache XML Security
> with other XML libraries? Especially with MS-XML 4?
> 
> 
> Thanks,
> 
> Reuven Nisser
>