Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^5: Simpler than XML::Simple

by Anonymous Monk
on Nov 25, 2010 at 15:19 UTC ( #873660=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Simpler than XML::Simple
in thread Simpler than XML::Simple

Ah, I meant XML::Rules :-)

I just tried to convert the sample XML from XML::Rules' SYNOPSIS into a schema:

trang test.xml test.rnc

And the result:

default namespace = ""

start =
  element doc {
    element person {
      element fname { xsd:NMTOKEN },
      element lname { xsd:NMTOKEN },
      element email { xsd:NMTOKEN },
      element address {
        element street { xsd:NMTOKEN },
        element city { xsd:NMTOKEN },
        element country { xsd:NMTOKEN },
        element bogus { xsd:NMTOKEN }
      },
      element phones {
        element phone {
          attribute type { xsd:NCName },
          xsd:NMTOKEN
        }+
      }
    }+
  }
Which looks quite reasonable. trang can also convert into .xsd files, which look uglier but are needed for XML::Compile operation.


Comment on Re^5: Simpler than XML::Simple
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2015-07-03 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls