Sebastian’s blog

Sebastian’s blog

Sebastian’s blog RSS Feed
 
 
 
 

Technobabble

To use namespace’d XMLs in Python-XML’s XPath implementation, you need to give XPath a dictionary of namespace mappings, like {”bpws”:”http://docs.oasis-open.org/wsbpel/2.0/process/executable”}. See here:

    context = Context(parser.doc, processorNss={"bpws":"http://docs.oasis-open.org/wsbpel/2.0/process/executable"})
    nodes = xpath.Evaluate("bpws:process/bpws:variables/*", parser.doc, context=context)
    print nodes

My question is: Why do I have to do this? My XML contains a perfectly valid namespace definition:

<bpws:process exitOnStandardFault="yes" suppressJoinFailure="yes" xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable">

Couldn’t find info on that on the net either. :(

Leave a Reply

Recent Posts

Categories

Archives

Recent Posts

Twitter

Blogs

Friends

FeedCount

Last.fm weekly artists

Meta

License

Creative Commons License
This work (text, author's own images) is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.