Имеется XML следующей структуры:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
<rsp code="ok">
<start>0
</start>
<limit>1
</limit>
<totalcount>491571
</totalcount>
<items>
<RemedyEntry>
<populationLevel>NORMAL</populationLevel>
<customerId>P000000615</customerId>
<data>
<key>ISS Ticket ID</key>
<value>SOCJ00700902147</value>
</data>
<data>
<key>LastWorkLog Entry</key>
<value>test
This ticket has been acknowledged by the SOC</value>
</data>
<data>
<key>LastWorkLog UpdatedBy</key>
<value>AR_ESCALATOR</value>
</data>
<data>
<key>LastWorkLog UpdateType</key>
<value>MSS</value>
</data>
<data>
<key>LastWorklogUpdate-DateTime</key>
<value>Sat Sep 21 14:45:51 GMT 2019</value>
</data>
<data>
<key>Private Work Log</key>
<value>This ticket has been linked to RCA# IDGAA5V0FDGR4APP2IYZPO4ZC1GS3O by user brian.murray===
Acknowledgement was done in 162495 minute(s)
( -161055 minute(s) left)
Justification: test ticket
asdf asd asdf asd fasdf asdfasdf asdf asdfasdf as
***********************************************
test
This ticket has been acknowledged by the SOC
***********************************************===
assigned to queue -- Demo Inbound
Issue Submitted as SR - Policy Tuning
(Re)Assigned to wodrich
***********************************************
test
***********************************************</value>
</data>
<data>
<key>Public Work Log</key>
<value>test
This ticket has been acknowledged by the SOC===
test</value>
</data>
<data>
<key>Modified Date</key>
<value>Thu Sep 26 12:21:59 GMT 2019</value>
</data>
<data>
<key>LastPrivateWorklogUpdate-DateTime</key>
<value>Sat Sep 21 14:45:51 GMT 2019</value>
</data>
<data>
<key>id</key>
<value>SOCJ00700902147</value>
</data>
<data>
<key>customerId</key>
<value>P000000615</value>
</data>
<data>
<key>partnerId</key>
<value>CIDD706860</value>
</data>
<id>SOCJ00700902147</id>
<schema>OPS:Trouble Ticket</schema>
<worklogData>
<key>Private Work Log</key>
<worklog>
<entries>
<text>This ticket has been linked to RCA# IDGAA5V0FDGR4APP2IYZPO4ZC1GS3O by user brian.murray</text>
<timestamp>2019-05-08T17:32:22Z</timestamp>
<type>MSS</type>
<username>brian.murray</username>
</entries>
<entries>
<text>Acknowledgement was done in 162495 minute(s)
( -161055 minute(s) left)
Justification: test ticket
asdf asd asdf asd fasdf asdfasdf asdf asdfasdf as
***********************************************
test
This ticket has been acknowledged by the SOC
***********************************************</text>
<timestamp>2012-07-07T13:08:50Z</timestamp>
<type>MSS</type>
<username>kproctor</username>
</entries>
<entries>
<text>assigned to queue -- Demo Inbound
Issue Submitted as SR - Policy Tuning
(Re)Assigned to wodrich
***********************************************
test
***********************************************</text>
<timestamp>2012-03-16T16:53:55Z</timestamp>
<type>MSS</type>
<username>wodrich</username>
</entries>
</worklog>
</worklogData>
<worklogData>
<key>Public Work Log</key>
<worklog>
<entries>
<text>test
This ticket has been acknowledged by the SOC</text>
<timestamp>2012-07-07T13:08:50Z</timestamp>
<type>MSS</type>
<username>kproctor</username>
</entries>
<entries>
<text>test</text>
<timestamp>2012-03-16T16:53:55Z</timestamp>
<type>MSS</type>
<username>wodrich</username>
</entries>
</worklog>
</worklogData>
</RemedyEntry>
</items>
</rsp>
Пытался создать валидный XSL. В браузере работает, но в DataStage нет.
Суть в том, что мне нужно достать из XML поля id, key и как текст всё начиная с тегов <worklog> </worklog> для Private Work Log и Public Work Log. Уже вижу в принципе ошибку, но что посоветуете вы, я думаю она не единственная.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="rsp/items/RemedyEntry">
<row>
<column name="id"> <xsl:for-each select="data"><xsl:if test="key = 'id'"><xsl:value-of select="value"/></xsl:if></xsl:for-each></column>
<column name="key"> <xsl:for-each select="worklogData"><xsl:value-of select="key"/></xsl:for-each></column>
<column name="TXT"> <xsl:for-each select="worklogData/worklog/entries">
<xsl:value-of select="text"/><xsl:value-of select="timestamp"/><xsl:value-of select="type"/><xsl:value-of select="username"/>
</xsl:for-each></column>
</row>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Потом это всё заливается в базу в виде CLOB.