jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Pelletier <ad...@moesol.com>
Subject Session.importXML() and namespaces.
Date Mon, 01 Oct 2007 19:23:28 GMT
I'm having trouble getting namespaces to resolve properly. 

My XML looks like:

<?xml version="1.0" encoding="UTF-8"?>
<mydoc xmlns="http://www.moesol.com" xmlns:md="http://www.moesol.com">
    <mydoc-inner key="foo" value="bar"/>
</mydoc>


My code sets up the namespace:

session.setNamespacePrefix("md", "http://www.moesol.com");
session.importXML(bvVswanCfg.absolute(), new 
FileInputStream(f_esdConfigFile), 
ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
session.save();


And my output looks like:

/bv/config/vswan/_pre2:mydoc/@jcr:primaryType = nt:unstructured
/bv/config/vswan/_pre2:mydoc/_pre2:mydoc-inner/@key = foo
/bv/config/vswan/_pre2:mydoc/_pre2:mydoc-inner/@value = bar
/bv/config/vswan/_pre2:mydoc/_pre2:mydoc-inner/@jcr:primaryType = 
nt:unstructured

I can't seem to wire the namespaces together and get "_pre2" in the 
output.  I was expecting this to be "md" and not "_pre2".

Thanks in advance.
Adam

Mime
View raw message