以文本方式查看主题 - 中文XML论坛 - 专业的XML技术讨论区 (http://bbs.xml.org.cn/index.asp) -- 『 XSL/XSLT/XSL-FO/CSS 』 (http://bbs.xml.org.cn/list.asp?boardid=8) ---- XMI到XML Schema的XSLT转换例子,我遇到问题! (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=12762) |
-- 作者:wxb_nudt -- 发布时间:12/14/2004 10:20:00 AM -- XMI到XML Schema的XSLT转换例子,我遇到问题! 本例子来源于http://www-900.ibm.com/developerWorks/cn/xml/x-wxxm25/ 我使用XMLSPY2004做XSLT转换时报错,先列举源文件如下,希望大家一起做出来: XMI文件:ModelAddress1.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="ModelAddress1.xsl"?> <XMI xmi.version="1.2" xmlns:UML="org.omg/UML/1.4"> <XMI.header> <XMI.documentation> <XMI.exporter>ananas.org stylesheet</XMI.exporter> </XMI.documentation> <XMI.metamodel xmi.name="UML" xmi.version="1.4"/> </XMI.header> <XMI.content> <UML:Model xmi.id="M.1" name="address" visibility="public" isSpecification="fase" isRoot="false" isLeaf="false" isAbstract="false"> <UML:Namespace.ownedElement> <UML:Stereotype xmi.id="S.1" name="root" visibility="public" isSpecification="false" baseClass="Class"> </UML:Stereotype> <UML:TagDefinition xmi.id="TD.1" name="position" isSpecification="false" tagType="String"> <UML:TagDefinition.owner> <UML:Stereotype xmi.id="S.1"/> </UML:TagDefinition.owner> </UML:TagDefinition> <UML:Class xmi.id="C.1" name="person" visibility="public" isSpecification="false" namespace="M.1" isRoot="true" isLeaf="true" isAbstract="false" isActive="false"> <UML:ModelElement.stereotype> <UML:Stereotype xmi.idref="S.1"/> </UML:ModelElement.stereotype> <UML:Classifier.feature> <UML:Attribute xmi.id="A.1" name="name" visibility="private" isSpecification="false" ownerScope="instance"/> <UML:Attribute xmi.id="A.2" name="telephone" visibility="private" isSpecification="false" ownerScope="instance"> <UML:StructuralFeature.multiplicity> <UML:Multiplicity> <UML:Multiplicity.range> <UML:MultiplicityRange lower="0" upper="5"/> </UML:Multiplicity.range> </UML:Multiplicity> </UML:StructuralFeature.multiplicity> </UML:Attribute> <UML:Attribute xmi.id="A.3" name="fax" visibility="private" isSpecification="false" ownerScope="instance"> <UML:StructuralFeature.multiplicity> <UML:Multiplicity> <UML:Multiplicity.range> <UML:MultiplicityRange lower="0" upper="5"/> </UML:Multiplicity.range> </UML:Multiplicity> </UML:StructuralFeature.multiplicity> </UML:Attribute> <UML:Attribute xmi.id="A.4" name="email" visibility="private" isSpecification="false" ownerScope="instance"> <UML:StructuralFeature.multiplicity> <UML:Multiplicity> <UML:Multiplicity.range> <UML:MultiplicityRange lower="0" upper="5"/> </UML:Multiplicity.range> </UML:Multiplicity> </UML:StructuralFeature.multiplicity> </UML:Attribute> </UML:Classifier.feature> </UML:Class> <UML:Class xmi.id="C.2" name="address" visibility="public" isSpecification="false" namespace="M.1" isRoot="true" isLeaf="true" isAbstract="false" isActive="false"> <UML:Classifier.feature> <UML:Attribute xmi.id="A.5" name="name" visibility="private" isSpecification="false" ownerScope="instance"/> <UML:Attribute xmi.id="A.6" name="street" visibility="private" isSpecification="false" ownerScope="instance"/> <UML:Attribute xmi.id="A.7" name="zip" visibility="private" isSpecification="false" ownerScope="instance"/> <UML:Attribute xmi.id="A.8" name="region" visibility="private" isSpecification="false" ownerScope="instance"/> <UML:Attribute xmi.id="A.9" name="city" visibility="private" isSpecification="false" ownerScope="instance"/> <UML:Attribute xmi.id="A.10" name="country" visibility="private" isSpecification="false" ownerScope="instance"/> </UML:Classifier.feature> </UML:Class> <UML:Class xmi.id="C.3" name="job" visibility="public" isSpecification="false" namespace="M.1" isRoot="true" isLeaf="true" isAbstract="false" isActive="false"> <UML:Classifier.feature> <UML:Attribute xmi.id="A.11" name="title" visibility="private" isSpecification="false" ownerScope="instance"/> <UML:Attribute xmi.id="A.12" name="organization" visibility="private" isSpecification="false" ownerScope="instance"/> </UML:Classifier.feature> </UML:Class> <UML:Association xmi.id="A.1" isSpecification="false"> <UML:ModelElement.taggedValue> <UML:TaggedValue xmi.id="T.1" isSpecification="false" dataValue="20"> <UML:TaggedValue.type> <UML:TagDefinition xmi.idref="TD.1"/> </UML:TaggedValue.type> </UML:TaggedValue> </UML:ModelElement.taggedValue> <UML:Association.connection> <UML:AssociationEnd xmi.id="AE.1" visibility="public" isSpecification="false" isNavigable="true"> <UML:AssociationEnd.participant> <UML:Class xmi.idref="C.1"/> </UML:AssociationEnd.participant> </UML:AssociationEnd> <UML:AssociationEnd xmi.id="AE.2" visibility="public" isSpecification="false" isNavigable="true"> <UML:AssociationEnd.participant> <UML:Class xmi.idref="C.2"/> </UML:AssociationEnd.participant> <UML:AssociationEnd.multiplicity> <UML:Multiplicity> <UML:Multiplicity.range> <UML:MultiplicityRange lower="1" upper="5"/> </UML:Multiplicity.range> </UML:Multiplicity> </UML:AssociationEnd.multiplicity> </UML:AssociationEnd> </UML:Association.connection> </UML:Association> <UML:Association xmi.id="A.2" isSpecification="false"> <UML:ModelElement.taggedValue> <UML:TaggedValue xmi.id="T.2" isSpecification="false" dataValue="120"> <UML:TaggedValue.type> <UML:TagDefinition xmi.idref="TD.1"/> </UML:TaggedValue.type> </UML:TaggedValue> </UML:ModelElement.taggedValue> <UML:Association.connection> <UML:AssociationEnd xmi.id="AE.3" visibility="public" isSpecification="false" isNavigable="true"> <UML:AssociationEnd.participant> <UML:Class xmi.idref="C.1"/> </UML:AssociationEnd.participant> </UML:AssociationEnd> <UML:AssociationEnd xmi.id="AE.4" visibility="public" isSpecification="false" isNavigable="true"> <UML:AssociationEnd.participant> <UML:Class xmi.idref="C.3"/> </UML:AssociationEnd.participant> </UML:AssociationEnd> </UML:Association.connection> </UML:Association> </UML:Namespace.ownedElement> </UML:Model> </XMI.content> </XMI> <xsl:output xi:suffix="xsd" indent="yes" xalan:indent-amount="2"/> <xsl:variable name="root-id" select="/XMI/XMI.content/UML:Model/UML:Namespace.ownedElement/UML:Stereotype[@name='root']/@xmi.id"/> <xsl:template match="XMI[@xmi.version='1.2']"> <xsl:template match="XMI"> <xsl:template match="UML:Model"> <xsl:template match="UML:Class"> <xsl:template match="UML:Association" mode="association"> <xsl:template match="UML:Class[UML:ModelElement.stereotype/UML:Stereotype/@xmi.idref=$root-id]" mode="association"> <xsl:template match="UML:Class" mode="association"> <xsl:template match="UML:Attribute"> <xsl:template match="UML:MultiplicityRange"> <xsl:template match="text()"> </xsl:stylesheet> XMLSPY报错为: |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
78.125ms |