<p dir="ltr">I am personal partial to Mojo::DOM though it does not have any actual XSD handling, it does xml just fine. That said, I would read through Matt Trout's recommendations here: <a href="http://shadow.cat/blog/matt-s-trout/mstpan-3/">http://shadow.cat/blog/matt-s-trout/mstpan-3/</a></p>
<p dir="ltr">Joel</p>
<div class="gmail_quote">On Jan 22, 2015 11:13 PM, "Jay Strauss" <<a href="mailto:me@heyjay.com">me@heyjay.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, <div><br></div><div>I have an XSD document like below.  I've been googling and cpan-ing, but can't find what I need (i know there are lots of XML packages), and I don't know how to parse it using regexs (reliably).  I just want to read in this XSD and navigate it like a perl structure, and extract field values like:</div><div><br></div><div>Field:ABS.1</div><div>Item:1514</div><div>Type:XCN</div><div>Table:HL70010</div><div>LongName:Discharge Care Provider</div><div><br></div><div>Field:ABS.2</div><div>...</div><div><br></div><div><br></div><div>Can anyone recommend a module or a method?</div><div><br></div><div>Thanks</div><div>Jay</div><div><br></div><div><br></div><div><div><?xml version ="1.0" encoding="UTF-8"?></div><div><!--</div><div>    v2.xml Message Definitions Version v2.5.1  - fields</div><div>    HL7® Version 2.5.1, Â© Health Level Seven, Inc.  All rights reserved.  HL7 and Health Level Seven are registered trademarks of Health Level Seven, Inc.</div><div>--></div><div><xsd:schema</div><div>    xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>"</div><div>    xmlns="urn:hl7-org:v2xml"</div><div>    xmlns:hl7="urn:com.sun:encoder-hl7-1.0"</div><div>    targetNamespace="urn:hl7-org:v2xml" xmlns:jaxb="<a href="http://java.sun.com/xml/ns/jaxb" target="_blank">http://java.sun.com/xml/ns/jaxb</a>" jaxb:version="2.0"></div><div><br></div><div>    <!-- include datatypes definitions for version v2.5.1 --></div><div>    <xsd:include schemaLocation="datatypes.xsd"/></div><div><br></div><div>    <xsd:annotation></div><div>        <xsd:appinfo source="urn:com.sun:encoder"></div><div>            <encoding xmlns="urn:com.sun:encoder" name="HL7 v2 Encoding" namespace="urn:com.sun:encoder-hl7-1.0" style="hl7encoder-1.0"/></div><div>        </xsd:appinfo></div><div>    </xsd:annotation></div><div><br></div><div>    <!--</div><div>        FIELD ABS.1</div><div>    --></div><div>    <xsd:attributeGroup name="ABS.1.ATTRIBUTES"></div><div>        <xsd:attribute name="Item" type="xsd:string" fixed="1514"/></div><div>        <xsd:attribute name="Type" type="xsd:string" fixed="XCN"/></div><div>        <xsd:attribute name="Table" type="xsd:string" fixed="HL70010"/></div><div>        <xsd:attribute name="LongName" type="xsd:string" fixed="Discharge Care Provider"/></div><div>    </xsd:attributeGroup></div><div>    <xsd:complexType name="ABS.1.CONTENT"></div><div>        <xsd:annotation></div><div>            <xsd:documentation xml:lang="en">Discharge Care Provider</xsd:documentation></div><div>            <xsd:appinfo source="urn:com.sun:encoder"></div><div>                <hl7:Item>1514</hl7:Item></div><div>                <hl7:Type>XCN</hl7:Type></div><div>                <hl7:Table>HL70010</hl7:Table></div><div>                <hl7:LongName>Discharge Care Provider</hl7:LongName></div><div>            </xsd:appinfo></div><div>        </xsd:annotation></div><div>        <xsd:complexContent></div><div>            <xsd:extension base="XCN"></div><div>                <xsd:attributeGroup ref="ABS.1.ATTRIBUTES"/></div><div>            </xsd:extension></div><div>        </xsd:complexContent></div><div>    </xsd:complexType></div><div>    <xsd:element name="ABS.1" type="ABS.1.CONTENT"/></div><div>    <!--</div><div>        FIELD ABS.2</div><div>    --></div><div>    <xsd:attributeGroup name="ABS.2.ATTRIBUTES"></div><div>        <xsd:attribute name="Item" type="xsd:string" fixed="1515"/></div><div>        <xsd:attribute name="Type" type="xsd:string" fixed="CE"/></div><div>        <xsd:attribute name="Table" type="xsd:string" fixed="HL70069"/></div><div>        <xsd:attribute name="LongName" type="xsd:string" fixed="Transfer Medical Service Code"/></div><div>    </xsd:attributeGroup></div><div>    <xsd:complexType name="ABS.2.CONTENT"></div><div>        <xsd:annotation></div><div>            <xsd:documentation xml:lang="en">Transfer Medical Service Code</xsd:documentation></div><div>            <xsd:appinfo source="urn:com.sun:encoder"></div><div>                <hl7:Item>1515</hl7:Item></div><div>                <hl7:Type>CE</hl7:Type></div><div>                <hl7:Table>HL70069</hl7:Table></div><div>                <hl7:LongName>Transfer Medical Service Code</hl7:LongName></div><div>            </xsd:appinfo></div><div>        </xsd:annotation></div><div>        <xsd:complexContent></div><div>            <xsd:extension base="CE"></div><div>                <xsd:attributeGroup ref="ABS.2.ATTRIBUTES"/></div><div>            </xsd:extension></div><div>        </xsd:complexContent></div><div>    </xsd:complexType></div><div>    <xsd:element name="ABS.2" type="ABS.2.CONTENT"/></div></div></div>
<br>_______________________________________________<br>
Chicago-talk mailing list<br>
<a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br></blockquote></div>