[英]XSLT: How to check if a child node has a specific name element and an empty value element?
[英]How to get the child element of a node in xslt without know element name?
我正在使用WSO2 BPS 3.2.0,並且想要獲取節點的子元素。 問題是我在設計時不知道子元素名稱。
我有XML數據
<Object>
<document xmlns="http://schemas.org/doc/1.1">
<type>...</type>
<date>...</date>
</document>
</Object>
要么
<Object>
<formular xmlns="http://schemas.org/doc/1.1">
<formType>...</formType>
<user>...</user>
</formular>
</Object>
節點<Object>
可以具有任何XML
我想刪除對象“信封”並返回內部XML。 如何通過XSLT解決此問題?
提前致謝。
您可以使用*
來匹配任何元素:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/Object">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="*">
<xsl:copy><xsl:apply-templates/></xsl:copy>
</xsl:template>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.