私は、XMLの下に持っていると私は次のようにサブノードを持つ最上位のノードとして参照されている入力XMLでXSLTXSLTは
を使用してXMLを次のように変換する必要があります。
<?xml version="1.0"?>
<referenced>
<name>PocTree/PocTree.services:getReferencesForServices</name>
<LOCK_STATUS>3</LOCK_STATUS>
<type>
<svc_type>flow</svc_type>
<svc_subtype>default</svc_subtype>
</type>
<path/>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>reference</status>
<reference>
<name>WmRoot/wm.server.ns.dependency:getReferenced</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>
<svc_type>java</svc_type>
<svc_subtype>unknown</svc_subtype>
</type>
<path>/Flow Path;1.0/INVOKE;0</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</reference>
<reference>
<name>WmPublic/pub.xml:documentToXMLString</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>
<svc_type>java</svc_type>
<svc_subtype>unknown</svc_subtype>
</type>
<path>/Flow Path;1.0/INVOKE;1</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</reference>
<reference>
<name>PocTree/PocTree.services:jkl</name>
<LOCK_STATUS>3</LOCK_STATUS>
<type>
<svc_type>xsltservice</svc_type>
<svc_subtype>unknown</svc_subtype>
</type>
<path>/Flow Path;1.0/INVOKE;2</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</reference>
<reference>
<name>WmPublic/pub.xml:xmlStringToXMLNode</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>
<svc_type>java</svc_type>
<svc_subtype>unknown</svc_subtype>
</type>
<path>/Flow Path;1.0/INVOKE;3</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</reference>
<reference>
<name>WmPublic/pub.xml:xmlNodeToDocument</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>
<svc_type>java</svc_type>
<svc_subtype>unknown</svc_subtype>
</type>
<path>/Flow Path;1.0/INVOKE;4</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</reference>
<reference>
<name>PocTree/PocTree.services:ghi</name>
<LOCK_STATUS>4</LOCK_STATUS>
<type>
<svc_type>xsltservice</svc_type>
<svc_subtype>unknown</svc_subtype>
</type>
<path>/Flow Path;1.0/INVOKE;5</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</reference>
<reference>
<name>WxPackageTree/WxPackageTree.doc:NodeInfo</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>
<type_name>record</type_name>
</type>
<path>/Service Path;1.0/signature;2;subPath;"/nodes;4;0;WxPackageTree.doc:NodeInfo"</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>reference</status>
<reference>
<name>WxPackageTree/WxPackageTree.doc:NodeInfo</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>
<type_name>record</type_name>
</type>
<path>/children;4;1;WxPackageTree.doc:NodeInfo</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>recursive</status>
</reference>
<reference>
<name>PocTree/PocTree.docs:nodeInfo</name>
<LOCK_STATUS>4</LOCK_STATUS>
<type>
<type_name>record</type_name>
</type>
<path>/Flow Path;1.0/MAP;6/MAPCOPY;1/to_field;-2;subPath;"/nodeInfo;4;0;PocTree.docs:nodeInfo"</path>
<path>/Flow Path;1.0/MAP;6/MAPCOPY;2/to_field;-2;subPath;"/nodeInfo;4;0;PocTree.docs:nodeInfo"</path>
<path>/Flow Path;1.0/MAP;6/MAPCOPY;3/to_field;-2;subPath;"/nodeInfo;4;0;PocTree.docs:nodeInfo"</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>reference</status>
<reference>
<name>PocTree/PocTree.docs:nodeInfo</name>
<LOCK_STATUS>4</LOCK_STATUS>
<type>
<type_name>record</type_name>
</type>
<path>/children;4;1;PocTree.docs:nodeInfo</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>recursive</status>
</reference>
</reference>
</reference>
</referenced>
期待される出力XML構造のようなものでなければなりません:
<?xml version="1.0"?>
<nodeInfo>
<name>PocTree/PocTree.services:getReferencesForServices</name>
<LOCK_STATUS>3</LOCK_STATUS>
<type>flow</type>
<path/>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>reference</status>
<children>
<name>WmRoot/wm.server.ns.dependency:getReferenced</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>java</type>
<path>/Flow Path;1.0/INVOKE;0</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</children>
<children>
<name>WmPublic/pub.xml:documentToXMLString</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>java</type>
<path>/Flow Path;1.0/INVOKE;1</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</reference>
<children>
<name>PocTree/PocTree.services:jkl</name>
<LOCK_STATUS>3</LOCK_STATUS>
<type>xsltservice</type>
<path>/Flow Path;1.0/INVOKE;2</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</children>
<children>
<name>WmPublic/pub.xml:xmlStringToXMLNode</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>java</type>
<path>/Flow Path;1.0/INVOKE;3</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</children>
<children>
<name>WmPublic/pub.xml:xmlNodeToDocument</name>
<LOCK_STATUS>2</LOCK_STATUS>
<type>java</type>
<path>/Flow Path;1.0/INVOKE;4</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</children>
<children>
<name>PocTree/PocTree.services:ghi</name>
<LOCK_STATUS>4</LOCK_STATUS>
<type>xsltservice</type>
<path>/Flow Path;1.0/INVOKE;5</path>
<isPub>false</isPub>
<isNotification>false</isNotification>
<isFlowServiceDisabled>false</isFlowServiceDisabled>
<status>resolved</status>
</children>
</nodeInfo>
しかし、期待される出力XMLを取得するための基準は、そのOの値からですこのセクションいつかこの意味のような余分なタグには、いずれかの子ノードを持っているかだけができていない
<type>
<svc_type>flow</svc_type>
<svc_subtype>default</svc_subtype>
</type>
で入力XMLのサブノードのNE。今、期待される出力XMLが<svc_type>
は「流れ」や「javaservice」または「xsltservice」の値を持ち、<type_name>
を持っていたもの<refrence>
タグを省略し、入力XMLからのみ<refrence>
のタグを選択したような方法を設計する必要があり
<type>
<type_name>record</type_name>
</type>
任意の値を持つ<type>
親ノードに属します。
も<svc_type>
の含有量は<type>
の値にマッピングされるべきであり、出力XMLは、その親ノード<type>
ためサブノード<svc_type>
と<svc_subtype>
を含むべきではありません。
このトピックに関するお手伝いをします。入力XML
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="referenced">
<nodeInfo>
<xsl:apply-templates />
</nodeInfo>
</xsl:template>
<xsl:template match="(reference[type/svc_type[contains(., 'flow') or contains(., 'java') or contains(., 'xsltservice')]]) and (reference[type/type_name[not(contains(.,'record'))]])">
<children>
<xsl:apply-templates />
</children>
</xsl:template>
</xsl:stylesheet>
しかし、XSLT上記のフィルタリングを達成するために書かれたXSLTを含め
はまだこの部分をカバーしていない - <svc_type>
は<type>
の値と出力XMLにマッピングする必要がありサブノード<svc_type>
と<svc_subtype>
を含めるべきではありません親ノードの場合は<type>
です。
これまでに何を試みましたか?あなたのコードを投稿してください!あなたがそれを走らせたとき何が起こったのですか?代わりに何が起こると思いますか?具体的に何が問題になっていますか? https://stackoverflow.com/help/mcve – Robert
@Robert - 質問の最後に書かれた部分的なxsltを追加しました。あなたは見て、助言してくださいできますか?出力については、の親ノードに属するのタグを除外することはできません。の値にマップする必要があります。は値に出力されます。その親ノードの –
Nis