2 messages in org.apache.jackrabbit.usersSession.importXML() and namespaces.
FromSent OnAttachments
Adam PelletierOct 1, 2007 12:23 pm 
Jukka ZittingOct 2, 2007 4:27 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Session.importXML() and namespaces.Actions...
From:Adam Pelletier (ada@moesol.com)
Date:Oct 1, 2007 12:23:05 pm
List:org.apache.jackrabbit.users

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