immo_we Posted October 30, 2012 Share Posted October 30, 2012 Hi is there any way to prevent via schema that the default namespace will be used vor a certain schema? currently I've defined this root element in the xml file: <rootEle name="Test4" schemaVersion="2.0" xmlns="http://www.example.org/testSchema"'>http://www.example.org/testSchema" xmlns:sch="http://www.example.org/testSchema"'>http://www.example.org/testSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/testSchema testSchema.xsd ">now I can use<sch:ele1> together with <ele1>both have the same meaning and this looks quite terrible for forming useful xpath queries.I would like to expect only elements in the form <sch:ele1> ... Immo Link to comment Share on other sites More sharing options...
Ingolme Posted October 30, 2012 Share Posted October 30, 2012 If they both have the same namespace then there's no way to distinguish them. You need another namespace if you want the elements to be different. Link to comment Share on other sites More sharing options...
boen_robot Posted November 6, 2012 Share Posted November 6, 2012 both have the same meaning and this looks quite terrible for forming useful xpath queries.Regardless of whether they're in the default namespace or not, you need to register the namespace URI in XPath, and assign a prefix for it (which doesn't have to be the one used in the document). After that, both will be matched against the same expressions. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now