我有一個要解析並轉換爲XML文件的XSD文件。Perl XSD解析
有什麼辦法可以使用Perl?生成xml文件後,我必須解析這是第二部分的xml文件,但我在將XSD文件轉換爲XML格式的第一部分中遇到了問題。下面
<?xml version="1.0" encoding="UTF-8"?>
<!-- This document was generated by the Objective Systems ASN2XSD Compiler
(http://www.obj-sys.com). Version: 6.3.0, Date: 06-May-2010. -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.obj-sys.com/S1AP-PDU-Descriptions"
targetNamespace="http://www.obj-sys.com/S1AP-PDU-Descriptions"
xmlns:S1AP-CommonDataTypes="http://www.obj-sys.com/S1AP-CommonDataTypes"
xmlns:S1AP-PDU-Contents="http://www.obj-sys.com/S1AP-PDU-Contents"
xmlns:S1AP-Constants="http://www.obj-sys.com/S1AP-Constants"
xmlns:asn1="http://www.obj-sys.com/v1.0/XMLSchema"
elementFormDefault="qualified">
<xsd:import namespace="http://www.obj-sys.com/S1AP-CommonDataTypes"
schemaLocation="S1AP-CommonDataTypes.xsd"/>
<xsd:import namespace="http://www.obj-sys.com/S1AP-PDU-Contents"
schemaLocation="S1AP-PDU-Contents.xsd"/>
<xsd:import namespace="http://www.obj-sys.com/S1AP-Constants"
schemaLocation="S1AP-Constants.xsd"/>
<xsd:import namespace="http://www.obj-sys.com/v1.0/XMLSchema"
schemaLocation="http://www.obj-sys.com/v1.0/XMLSchema/asn1.xsd"/>
<!-- PDU definition -->
<xsd:element name="s1AP-PDU" type="S1AP-PDU"/>
<xsd:complexType name="S1AP-PDU">
<xsd:choice>
<xsd:element name="initiatingMessage" type="InitiatingMessage"/>
<xsd:element name="successfulOutcome" type="SuccessfulOutcome"/>
<xsd:element name="unsuccessfulOutcome" type="UnsuccessfulOutcome"/>
<xsd:any namespace="##other" processContents="lax"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="InitiatingMessage">
<xsd:sequence>
<xsd:element name="procedureCode" type="S1AP-CommonDataTypes:ProcedureCode"/>
<xsd:element name="criticality" type="S1AP-CommonDataTypes:Criticality"/>
<xsd:element name="value" type="asn1:OpenType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SuccessfulOutcome">
<xsd:sequence>
<xsd:element name="procedureCode" type="S1AP-CommonDataTypes:ProcedureCode"/>
<xsd:element name="criticality" type="S1AP-CommonDataTypes:Criticality"/>
<xsd:element name="value" type="asn1:OpenType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="UnsuccessfulOutcome">
<xsd:sequence>
<xsd:element name="procedureCode" type="S1AP-CommonDataTypes:ProcedureCode"/>
<xsd:element name="criticality" type="S1AP-CommonDataTypes:Criticality"/>
<xsd:element name="value" type="asn1:OpenType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
在java中有一個工具,您可以嘗試通過googleing – rpg 2011-04-05 14:51:31