immo_we 1 Posted October 30, 2012 Report 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 Quote Link to post Share on other sites
Ingolme 1,020 Posted October 30, 2012 Report 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. Quote Link to post Share on other sites
boen_robot 107 Posted November 6, 2012 Report 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.