gpt4 book ai didi

XSLT:将 变成

转载 作者:行者123 更新时间:2023-12-04 07:06:02 28 4
gpt4 key购买 nike

我需要怎么做:

    <xsl:template match="xs:simpleType">
<xsl:copy>
<xsl:copy-of select="node()[not(self::xs:annotation or self::xs:restriction)]|@*"/>
</xsl:copy>
</xsl:template>

目前,事实证明:
<xs:simpleType xmlns:core="urn:org:pesc:core:CoreMain:v1.4.0" name="SINIDType">


</xs:simpleType>

我更喜欢它看起来像:
<xs:simpleType name="SINIDType" />

最佳答案

有了这些空行,看起来您的 select 语句是(正确地)选择您的空白节点以及您的元素。尝试使用

select="*[not(self::xs:annotation or self::xs:restriction)]|@*"

它只会匹配元素节点,而不是文本节点。

关于XSLT:将 <element></element> 变成 <element/>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1101817/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com