denzil_cactus has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I am trying to parse the xml files with two different schemas but I need to use one program only so that we could read or parse all different schema files. Can anybody suggest me to implement this? Thanks
  • Comment on How to parse the XML file as per different schema

Replies are listed 'Best First'.
Re: How to parse the XML file as per different schema
by dHarry (Abbot) on Oct 30, 2008 at 14:52 UTC

    Do you want to validate the same XML file against different schemas??? Please elaborate exactly what you are trying to do. If possible add an example. To me it seems every validating parser can be used.

      Well I would need to parse different XML files with quite a bit different schemas like
      xml 1
      <student>
      <name>denz</name>
      <section>B</section>
      <subject>CHEM</subject>
      </student>
      xml 2
      <student>
      <name>denz</name>
      <marks>40</marks>
      <university>LONDON</university>
      </student>
      so now I want to use one unique program which should parse
      any file with a different schema. Can we do this?
Re: How to parse the XML file as per different schema
by Zen (Deacon) on Oct 30, 2008 at 15:07 UTC
    Write one program with separate subs or packages for each schema.
Re: How to parse the XML file as per different schema
by ikegami (Patriarch) on Oct 30, 2008 at 19:24 UTC
    Unlike SGML derivatives such as HTML, parsing XML derivatives doesn't require knowing their schema. You'll have to clarify your question.
Re: How to parse the XML file as per different schema
by Anonymous Monk on Oct 30, 2008 at 14:51 UTC