shulin Posted September 28, 2007 Share Posted September 28, 2007 Hi: For the following XML , how do I write an XSD?<networknode> <configparam> ... <\configparam> <networknode> <configparam> ... <\configparam> <configparam> ... <\configparam> <networknode> <configparam> ... <\configparam> <configparam> ... <\configparam> <\networknode> <\networknode><\networknode>That is, the same name <networknode> is used for both parents and children.Thanks.shu-lin Link to comment Share on other sites More sharing options...
boen_robot Posted September 28, 2007 Share Posted September 28, 2007 A quick starting schema: <?xml version="1.0"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="networknode"> <xsd:complexType> <xsd:sequence> <xsd:element name="configparam" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/> <xsd:element ref="networknode" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element></xsd:schema> Provided that All configparam elements come before new networknode elements. configparam elements contain only pure text. If you want something more, you're going to have to edit the types of the two elements. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.