Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: (RFC) XML::Rules - yet another XML parser

by Jenda (Abbot)
on Oct 30, 2006 at 20:46 UTC ( #581375=note: print w/ replies, xml ) Need Help??


in reply to (RFC) XML::Rules - yet another XML parser

Regarding the namespace support ... I think the easiest solution is to allow the module users to use namespace prefixes when specifying the rules, but at the same time let (or even force) them to specify what prefix belongs to what namespace. So that if the XML producer decides to use a different prefix for the same namespace the module will convert it behind the scenes.

$parser = XML::Rules->new( rules => [ 'SOAP-ENV:Envelope' => ..., 'job:Location' => ... ... ], namespaces => { 'http://schemas.xmlsoap.org/soap/envelope/' => 'SOAP-ENV', 'http://www.foo.com/schemas/job.xsd' => 'job', ... }, );
And then no matter what prefix there is in the parsed XML, the rules starting with 'job:' will be used for tags in namespace 'http://www.foo.com/schemas/job.xsd'. Does this make sense?


Comment on Re: (RFC) XML::Rules - yet another XML parser
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://581375]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-08-22 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (145 votes), past polls