How to pull data from a previous node - xslt-1.0

I've come across a challenge I struggle with to find the right approach for. The information required is in two different nodes but belong to the same information for a device.
The later node contains the target information for the previous node as per picture:
The phone device has two nodes where information over the device is stored, IP Phones and Workstations. Under Workstations the main information is stored with a key that links it to the IP Phones section.
I have the following code:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<body>
<table border="1">
<tr>
<td><strong>Name</strong></td>
<td><strong>Software Version</strong></td>
<td><strong>Status</strong></td>
</tr>
<xsl:for-each select="ENTRY/ENTRY/ENTRY/ENTRY/ENTRY">
<xsl:if test="#CLASS='Workstation'">
<tr>
<td><xsl:value-of select="#NAME"/></td>
<xsl:for-each select="ATTRIBUTE">
<xsl:if test="#NAME='Managed IP Phone'">
<xsl:call-template name="Phone_Data">
<xsl:with-param name="IPPhone" select="VALUE"/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
<td>.</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<!-- Additional templates to pull 2nd phone node data. -->
<xsl:template name="Phone_Data">
<xsl:param name="IPPhone"/>
<td> <xsl:value-of select="$IPPhone"/> </td> <!-- -->
<xsl:for-each select="../ENTRY">
<xsl:if test="#NAME='IP Phones'">
<xsl:for-each select="ENTRY">
<xsl:if test="#NAME=$IPPhone">
<xsl:for-each select="ATTRIBUTE">
<!-- This is an attribute under the IP Phones - GBADM104_ENTRY -->
<xsl:if test="#NAME='Software Version'">
<td><xsl:value-of select="VALUE"/></td>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Coming from the GBADM104_ENTRY under the Workstations node, it does not provide me with the information I expected to get from the GBADM104_ENTRY under the IP Phones node in the screenshot.
As I am a novice, I obviously have made a mistake in the Phone_Data template to target the node with the data I require. I don't know whether or not one could give me suggestions on how to do this the right way please?
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by DSEdit -->
<ENTRY NAME="CustomerSite" CLASS="Site">
<ENTRY NAME="Production" CLASS="Configuration Set">
<ENTRY NAME="REG6699CIC01" CLASS="Server">
<ENTRY NAME="IP Phones" CLASS="IP Phones">
<ENTRY NAME="51948094-c6e6-4fb9-bb76-ba1986c51429" CLASS="IP Phone">
<ATTRIBUTE NAME="VAD">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Software Version">
<VALUE>3.2.7.0198</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Call Park">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Status">
<VALUE>Current</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Station Type">
<VALUE>Workstation</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="ReloadedLast">
<VALUE>20140825143741Z</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="MAC Address">
<VALUE>0004F24F4012</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Name">
<VALUE>GBADM103</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Date Last Modified">
<VALUE>1406660976</VALUE>
</ATTRIBUTE>
</ENTRY>
<ENTRY NAME="51dbb1fe-9957-420a-bfc3-3f4d9bc1b2fc" CLASS="IP Phone">
<ATTRIBUTE NAME="Software Version">
<VALUE>3.2.7.0198</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Status">
<VALUE>Current</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Station Type">
<VALUE>Workstation</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="ReloadedLast">
<VALUE>20140912074858Z</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="MAC Address">
<VALUE>0004F2B37167</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Name">
<VALUE>GBADM104</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Date Last Modified">
<VALUE>1410881183</VALUE>
</ATTRIBUTE>
</ENTRY>
<ENTRY NAME="51eace77-7f6d-467a-bbac-b27329229c53" CLASS="IP Phone">
<ATTRIBUTE NAME="VAD">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Software Version">
<VALUE>3.2.7.0198</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Status">
<VALUE>Current</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Station Type">
<VALUE>Workstation</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="ReloadedLast">
<VALUE>20140814104810Z</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="MAC Address">
<VALUE>0004F24F3E3B</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Persistent">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="IP Address">
<VALUE>10.254.250.61</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Name">
<VALUE>GBADS201</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Date Last Modified">
<VALUE>1406899229</VALUE>
</ATTRIBUTE>
</ENTRY>
<ATTRIBUTE NAME="Security">
<VALUE>Minimal</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Call Ringback Timeout">
<VALUE>0</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="VQM Collector Periodic Trigger">
<VALUE>0</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Codec Pref">
<VALUE>0|G.711 mu-law|</VALUE>
<VALUE>1|G.711 a-law|</VALUE>
<VALUE>2|G.729AB|</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Active">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Use 486 For Reject">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Emergency Customer Name">
<VALUE>Regus</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Call Waiting Tone">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Connection Type">
<VALUE>SIPAddress</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Sync Forward To IC Status">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="IsSupportedRingSets">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="SIP ID Address SYNC">
<VALUE>Sync Dynamic</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="VQM Collector Session">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="SIP Receive Port">
<VALUE>5060</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Audio Path">
<VALUE>Always In</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="VAD">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Proxy Group">
<VALUE>3b6b817b-73e5-4db5-b6d5-57eb0f9b26ff</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Polycom Override Date Date Top">
<VALUE>D</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Software Version">
<VALUE>3.2.7.0198</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Emergency Location Description">
<VALUE>15305 Dallas Parkway Suite 300, Addison, TX, 75001</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Polycom Headset Microphone Gain">
<VALUE>21</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Call Park">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Region Location">
<VALUE>North America</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Status">
<VALUE>Current</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Polycom Override Date Format">
<VALUE>D</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Emergency Numbers">
<VALUE>911</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature URL Dialing">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="DTMF Off Time">
<VALUE>80</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Station Type">
<VALUE>Workstation</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="VQM Collector Periodic">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="One Touch Voicemail">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Ring Always">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Regional Tone Set">
<VALUE>Language_Default</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="VQM RTCP-XR">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="ExpansionModules">
<VALUE>0</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Polycom Call Waiting">
<VALUE>beep</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Enable Handsfree">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Polycom NumberFirstCID">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Interface Language">
<VALUE>English_United_States</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Headset Echo-Noise Suppression">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Call List">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Polycom Override Date Long Format">
<VALUE>D</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="SIP Session Timeout">
<VALUE>60</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="ReloadedLast">
<VALUE>20140905170113Z</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Phone Manufacturer">
<VALUE>Polycom</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Disable Delayed Media">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Station Appearances">
<VALUE>0|Private|USISM010|Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Inbound SIP Security Challenge">
<VALUE>none</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Call per Station">
<VALUE>1</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Bus Gain">
<VALUE>0</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="RTP QOS Byte">
<VALUE>B8</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Call Dialtone Timeout">
<VALUE>15</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Call List Placed">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Password">
<VALUE>F08470F66758CE835CA9DD495F57E5B433F03937D78CFA01CAC315492D7F167C</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Location NTP Server Overrides DHCP">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Electronic Hookswitch Mode">
<VALUE>0</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Authentication">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Echo Cancellation">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Phone Limits Calls Per Line Key">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Presence">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="TimeZone">
<VALUE>CST</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Phone Model">
<VALUE>IP331</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Persist Handset Volume">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="SIP Register Interval">
<VALUE>86400</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="MWI Message Light">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Audio Protocol">
<VALUE>RTP</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="VQM Collector Period">
<VALUE>20</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Polycom Override 24 Hour Clock">
<VALUE>D</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Polycom Headset Sidetone Gain">
<VALUE>-3</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Use SIP Session Timer">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Media Port Start Range">
<VALUE>2222</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Dialplan Digitmap Timeout">
<VALUE>3|1|3|3</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Call Offering Timeout">
<VALUE>0</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="DefaultLabelType">
<VALUE>Station</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Group Call Pickup">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Syslog Transport">
<VALUE>1</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="MAC Address">
<VALUE>0004F2A72B5F</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Location Description">
<VALUE>Colonnade</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Sync DND To IC Status">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Polycom Headset Speaker Gain">
<VALUE>4</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Persistent">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Disable App Logs When Using Syslog">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Location Time Zone Overrides DHCP">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="User Name">
<VALUE>38bc4dfa7e384f29bb7e62fc24dac94d</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="IP Address">
<VALUE>10.175.250.106</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Terminate Call Analysis On Connect">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Disconnect on Broken RTP">
<VALUE>0</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Syslog Render Level">
<VALUE>0</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Headset Mode">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="DTMF On Time">
<VALUE>80</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="DTMF Type">
<VALUE>RFC2833</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Persist Headset Volume">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Call List Received">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="SIP QOS Byte">
<VALUE>Not Set</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Dial On Offhook">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Use Proxy">
<VALUE>Not Set</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Network Gain">
<VALUE>0</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Disallow Media Server Passthru">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Directory">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="External Devices Determine Codecs">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Connection Call Warm Down Time">
<VALUE>5</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Messaging">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="DTMF Payload">
<VALUE>101</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Handset Echo-Noise Suppression">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Disable Delayed Media reINVITE">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Name">
<VALUE>USISM010</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Persist Handsfree Volume">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="IP3X0 Line 2 Key Function">
<VALUE>Line2</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Feature Call List Missed">
<VALUE>No</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Emergency Outbound ANI">
<VALUE>19727152000</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Dialplan Digitmap">
<VALUE>x.T|*T|*905|*90[1-4]x.T</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Allow SIP Registration">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Date Last Modified">
<VALUE>1372825753</VALUE>
</ATTRIBUTE>
</ENTRY>
</ENTRY>
<ENTRY NAME="Workstations" CLASS="Workstations">
<ENTRY NAME="GBADM103" CLASS="Workstation">
<ATTRIBUTE NAME="Security">
<VALUE>Minimal</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Active">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Counted Licenses">
<VALUE>I3_LICENSE_BASIC_STATION</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Connection Type">
<VALUE>SIPAddress</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="SIP ID Address">
<VALUE>GBADM103</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Station Type">
<VALUE>Workstation</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Managed Label">
<VALUE>GBADM103</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Line">
<VALUE>sip:GBADM103#192.168.1.203:5060</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Licenses Enabled">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="MAC Address">
<VALUE>0004F2B37157</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Managed IP Phone">
<VALUE>51948094-c6e6-4fb9-bb76-ba1986c51429</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Date Last Modified">
<VALUE>1410882147</VALUE>
</ATTRIBUTE>
</ENTRY>
<ENTRY NAME="GBADM104" CLASS="Workstation">
<ATTRIBUTE NAME="Counted Licenses">
<VALUE>I3_LICENSE_BASIC_STATION</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="SIP ID Address">
<VALUE>GBADM104</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Managed Label">
<VALUE>GBADM104</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Extension">
<VALUE>903104</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Line">
<VALUE>sip:GBADM104#192.168.1.204:5060</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="MAC Address">
<VALUE>0004F2B37167</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Persistent">
<VALUE>Yes</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Managed IP Phone">
<VALUE>51dbb1fe-9957-420a-bfc3-3f4d9bc1b2fc</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Date Last Modified">
<VALUE>1410881183</VALUE>
</ATTRIBUTE>
</ENTRY>
<ENTRY NAME="GBADS201" CLASS="Workstation">
<ATTRIBUTE NAME="Counted Licenses">
<VALUE>I3_LICENSE_BASIC_STATION</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Connection Type">
<VALUE>SIPAddress</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="SIP ID Address">
<VALUE>GBADS201</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Station Type">
<VALUE>Workstation</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Managed Label">
<VALUE>GBADS201</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="MAC Address">
<VALUE>UK1058597LT.uk-eire.regus.local</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Managed IP Phone">
<VALUE>51eace77-7f6d-467a-bbac-b27329229c53</VALUE>
</ATTRIBUTE>
<ATTRIBUTE NAME="Date Last Modified">
<VALUE>1372819315</VALUE>
</ATTRIBUTE>
</ENTRY>
</ENTRY>
</ENTRY>
</ENTRY>
</ENTRY>

I am mostly guessing here. The following stylesheet:
XSLT 1.0
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration="yes" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:key name="entry-by-name" match="ENTRY" use="#NAME" />
<xsl:template match="/">
<html>
<body>
<table border="1">
<tr>
<th>Name</th>
<th>Software Version</th>
<th>Status</th>
</tr>
<xsl:for-each select="ENTRY/ENTRY/ENTRY/ENTRY[#CLASS='Workstation']">
<tr>
<td>
<xsl:value-of select="#NAME"/>
</td>
<td>
<xsl:value-of select="key('entry-by-name', ATTRIBUTE[#NAME='Managed IP Phone']/VALUE)/ATTRIBUTE[#NAME='Software Version']/VALUE"/>
</td>
<td>.</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
applied to your example input (corrected for well-formedness!) will produce the following result:
<html>
<body>
<table border="1">
<tr>
<th>Name</th>
<th>Software Version</th>
<th>Status</th>
</tr>
<tr>
<td>GBADM103</td>
<td>3.2.7.0198</td>
<td>.</td>
</tr>
<tr>
<td>GBADM104</td>
<td>3.2.7.0198</td>
<td>.</td>
</tr>
<tr>
<td>GBADS201</td>
<td>3.2.7.0198</td>
<td>.</td>
</tr>
</table>
</body>
</html>
rendered as:
Note the use of predicates to select the nodes of interest, and the use of key to lookup data from another branch of the XML input.

Related

can anyone please assist how to add Array resource in the XML (CLOB ) using the SQL?

<?xml version="1.0" encoding="UTF-8"?>
<Values version="2.0">
<record name="header" javaclass="com.wm.util.Values">
<value name="legalEntity">27</value>
<value name="globalId">a8a49f5d-70bb-421e-99f2-bb4065a46538</value>
<value name="priority">5</value>
<value name="requestor">COP</value>
</record>
<record name="body" javaclass="com.wm.util.Values">
<array name="orderItem" type="record" depth="1">
<record javaclass="com.wm.util.Values">
<value name="orderItemId">OS-1229460</value>
<array name="childOrderItem" type="record" depth="1">
<record javaclass="com.wm.util.Values">
<value name="orderItemId">280973171</value>
<array name="relatedOrderItem" type="record" depth="1">
<record javaclass="com.wm.util.Values">
<value name="orderType">CUSTOMER_ORDER</value>
<value name="orderItemId">280973171</value>
<value name="orderItemDataOwner">Clarify</value>
</record>
</array>
<value name="operationType">CANCEL</value>
<value name="operationSubType">DEFAULT</value>
<value name="status"> </value>
<value name="subStatus"> </value>
<value name="orderItemDateTime">2020-12-08T17:00:52</value>
<value name="articleNumber">STANDAARDSIMKAART</value>
<array name="childOrderItem" type="record" depth="1">
<record javaclass="com.wm.util.Values">
<value name="orderItemId">280973179</value>
<value name="operationType">CANCEL</value>
<value name="operationSubType">DEFAULT</value>
<value name="status"> </value>
<value name="subStatus"> </value>
<record name="product" javaclass="com.wm.util.Values">
<value name="productInstanceId">280973179</value>
<value name="productSpecificationId">SE555</value>
<value name="productSpecificationName">PRIVATE_APN</value>
<value name="productDescription">PRIVATE_APN</value>
<value name="productType">PRIVATE_APN</value>
<value name="manualOverride">false</value>
</record>
</record>
</array>
</record>
</array>
</record>
</array>
</record>
</Values>
To be more precise i have to add this Array resource After the manual override line
<array name="productInstanceCharacterstic" type="record" depth="1">
<record javaclass="com.wm.util.Values">
<value name="name">APNProductInstanceID</value>
<value name="value">281606343</value>
</record>
<record javaclass="com.wm.util.Values">
<value name="name">UseStaticIP</value>
<value name="value">No</value>
</record>
</array>
My code :
UPDATE SD2_95.ORDER_DATA sgo SET sgo.ORDER_CONTENT =
(XMLSERIALIZE
(
Document
(
XMLQuery
(
'copy $tmp := . modify
(for $i in $tmp//record[#name="body"]/value[#name=]/text()
return $tmp'
PASSING XMLTYPE(sgo.ORDER_CONTENT) RETURNING CONTENT
)
) AS CLOB INDENT SIZE = 2
)
)
WHERE sgo.ORDER_ID IN
(
'OS-1151955',
)
I am not sure how to implement the for loop... please help

Attachment entity without body tag

Issue : I am using email attachment entity to receive email with attachments.
Our environment is - D365. When Email is sent using outlook or d365 as well, the attachment entity is without body tag
Steps to reproduce
Create attachment locally (can be any extension or encoding)
Send email either to account synced with D365 or use D365 to send email to same along with attachment.
query email with attachments and also get body tag
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
<entity name="email" >
<attribute name="modifiedon" />
<attribute name="sender" />
<order attribute="modifiedon" descending="false" />
<filter>
<condition attribute="modifiedon" operator="on-or-after" value="2020-03-25" />
</filter>
<link-entity name="activitymimeattachment" from="objectid" to="activityid" link-type="inner" alias="ak" >
<attribute name="filename" />
<attribute name="body" />
</link-entity>
</entity>
</fetch>
o Expected output.
<resultset morerecords="0">
<result>
<modifiedon date="3/27/2020" time="3:08 PM">2020-03-27T15:08:54+05:30</modifiedon>
<sender> xyz#abc.com</sender>
<ak.filename>test-20181009T133141.xml</ak.filename>
<ak.body>VGhlIFVSTCBzaG91bGQgYmUgY29udmVydGVkIHRvIEJhc2U2NA==</ak.body>
</result>
</resultset>
•
o Received output.
<resultset morerecords="0">
<result>
<modifiedon date="3/27/2020" time="4:04 PM">2020-03-27T16:04:24+05:30</modifiedon>
<sender>xyz#abc.com</sender>
<ak.filename>test-2019-04-17T200954.660.xml</ak.filename>
</result>
<result>
<modifiedon date="3/27/2020" time="4:12 PM">2020-03-27T16:12:15+05:30</modifiedon>
<sender> xyz#abc.com</sender>
<ak.filename>image002.jpg</ak.filename>
</result>
<result>
<modifiedon date="3/27/2020" time="4:12 PM">2020-03-27T16:12:15+05:30</modifiedon>
<sender> xyz#abc.com</sender>
<ak.filename>image004.jpg</ak.filename>
</result>
<result>
<modifiedon date="3/27/2020" time="4:12 PM">2020-03-27T16:12:15+05:30</modifiedon>
<sender> xyz#abc.com</sender>
<ak.filename>image006.jpg</ak.filename>
</result>
</resultset>
Please help us in finding the root cause of this issue.
You have to remove distinct="true" form your fetchxml and then it shall work.
Try below fetchxml
<fetch version="1.0" output-format="xml-platform" mapping="logical" >
<entity name="email" >
<attribute name="modifiedon" />
<attribute name="sender" />
<order attribute="modifiedon" descending="false" />
<filter>
<condition attribute="modifiedon" operator="on-or-after" value="2020-03-25" />
</filter>
<link-entity name="activitymimeattachment" from="objectid" to="activityid" link-type="inner" alias="ak" >
<attribute name="filename" />
<attribute name="body" />
</link-entity>
</entity>
</fetch>

Extracting names From multi Level XML into Sql Column

Please can someone help me figure out how I can extract the names of the XML structure below. What I am after is a flat table with the location if each data item.
The first few will be just at the high level
BusinessID
Date Submitted
E-mail etc
However when I get to questions I need the full location.
Questions.Questions1.Questions11.Questions111
So the table will look something like
BusinessID
Date Submitted
E-mail
Questions.Questions1.Questions11.Questions111
Questions.Questions1.Questions12.Questions121
Questions.Questions1.Questions12.Questions122
Questions.Questions1.Questions12.Questions123
Questions.Questions1.Questions12.Other
Questions.Questions1.Questions13.Questions131
Questions.Questions1.Questions13.Questions132
This is my XML:
<AdapterItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas/Data">
<Attributes>
<Attribute>
<Name>BusinessID</Name>
<Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">?????</Value>
</Attribute>
<Attribute>
<Name>Date Submitted</Name>
<Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:dateTime">?????</Value>
</Attribute>
<Attribute>
<Name>E-mail</Name>
<Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">?????</Value>
</Attribute>
<Attribute>
<Name>Language</Name>
<Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">English (United Kingdom)</Value>
</Attribute>
<Attribute>
<Name>Type</Name>
<Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">??????????</Value>
</Attribute>
<Attribute>
<Name>Submission Channel</Name>
<Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Web</Value>
</Attribute>
<Attribute>
<Name>Anonymous</Name>
<Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">false</Value>
</Attribute>
<Attribute>
<Name>Questions</Name>
<Value i:type="AdapterItem">
<Attributes>
<Attribute>
<Name>Questions1</Name>
<Value i:type="AdapterItem">
<Attributes>
<Attribute>
<Name>Questions11</Name>
<Value i:type="AdapterItem">
<Attributes>
<Attribute>
<Name>Questions111</Name>
<Value xmlns:d13p1="http://www.w3.org/2001/XMLSchema" i:type="d13p1:string">Questions111 Answer</Value>
</Attribute>
</Attributes>
</Value>
</Attribute>
<Attribute>
<Name>Questions12</Name>
<Value i:type="AdapterItem">
<Attributes>
<Attribute>
<Name>Questions121</Name>
<Value xmlns:d13p1="http://www.w3.org/2001/XMLSchema" i:type="d13p1:string">false</Value>
</Attribute>
<Attribute>
<Name>Questions122</Name>
<Value xmlns:d13p1="http://www.w3.org/2001/XMLSchema" i:type="d13p1:string">false</Value>
</Attribute>
<Attribute>
<Name>Questions123</Name>
<Value xmlns:d13p1="http://www.w3.org/2001/XMLSchema" i:type="d13p1:string">false</Value>
</Attribute>
<Attribute>
<Name>Other</Name>
<Value xmlns:d13p1="http://www.w3.org/2001/XMLSchema" i:type="d13p1:string">false</Value>
</Attribute>
</Attributes>
</Value>
</Attribute>
<Attribute>
<Name>Questions13</Name>
<Value i:type="AdapterItem">
<Attributes>
<Attribute>
<Name>Questions131</Name>
<Value xmlns:d13p1="http://www.w3.org/2001/XMLSchema" i:type="d13p1:string">TEST business</Value>
</Attribute>
<Attribute>
<Name>Questions132</Name>
<Value i:type="AdapterItem">
<Attributes>
<Attribute>
<Name>Questions1321</Name>
<Value xmlns:d16p1="http://www.w3.org/2001/XMLSchema" i:type="d16p1:string">Damaged</Value>
</Attribute>
<Attribute>
<Name>Questions1322</Name>
<Value i:type="AdapterItem">
<Attributes>
<Attribute>
<Name>Questions13221</Name>
<Value xmlns:d19p1="http://www.w3.org/2001/XMLSchema" i:type="d19p1:string">TEST</Value>
</Attribute>
<Attribute>
<Name>Questions13222</Name>
<Value xmlns:d19p1="http://www.w3.org/2001/XMLSchema" i:type="d19p1:string">Metal</Value>
</Attribute>
<Attribute>
<Name>Questions13223</Name>
<Value xmlns:d19p1="http://www.w3.org/2001/XMLSchema" i:type="d19p1:string">true</Value>
</Attribute>
<Attribute>
<Name>Questions13224</Name>
<Value xmlns:d19p1="http://www.w3.org/2001/XMLSchema" i:type="d19p1:string">false</Value>
</Attribute>
<Attribute>
<Name>Questions13225</Name>
<Value xmlns:d19p1="http://www.w3.org/2001/XMLSchema" i:type="d19p1:string">false</Value>
</Attribute>
</Attributes>
</Value>
</Attribute>
</Attributes>
</Value>
</Attribute>
</Attributes>
</Value>
</Attribute>
</Attributes>
</Value>
</Attribute>
</Attributes>
</Value>
</Attribute>
</Attributes>
</AdapterItem>
I have been trying to figure this out but I cannot figure out how to get the names instead of the values
DECLARE #xml as xml
SET #xml = (SELECT data);
WITH Xml_CTE AS
(
SELECT
CAST('/' + node.value('fn:local-name(.)',
'varchar(100)') AS varchar(100)) AS name,
node.query('*') AS children
FROM #xml.nodes('/*') AS roots(node)
UNION ALL
SELECT
CAST(x.name + '/' +
node.value('fn:local-name(.)', 'varchar(100)') AS varchar(100)),
node.query('*') AS children
FROM Xml_CTE x
CROSS APPLY x.children.nodes('*') AS child(node)
)
SELECT DISTINCT name
FROM Xml_CTE
OPTION (MAXRECURSION 1000)

How to understand XACML Response?

I worked with the below policy and i am unable to understand the XACML Response.
The policy which i am using is
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="TestPolicy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0">
<Target>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">foo1</AttributeValue>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
</Match>
</AllOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">foo2</AttributeValue>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
</Match>
</AllOf>
</AnyOf>
</Target>
<Rule Effect="Permit" RuleId="Rule-1">
<Condition>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:and">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">write</AttributeValue>
</Apply>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
</Apply>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">bob1</AttributeValue>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">bob2</AttributeValue>
</Apply>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
</Apply>
</Apply>
</Condition>
</Rule>
<Rule Effect="Deny" RuleId="Deny-Rule"/>
</Policy>
XACML Request
<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="true">
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">write</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" IncludeInResult="false">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">bob2</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">index.jsp</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Descendants</AttributeValue>
</Attribute>
</Attributes>
</Request>
XACML Response
<Response xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17">
<Result>
<Decision>Permit</Decision>
<Status>
<StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/>
</Status>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">foo2</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">foo1</AttributeValue>
</Attribute>
</Attributes>
</Result>
<Result>
<Decision>Permit</Decision>
<Status>
<StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/>
</Status>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">foo2</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">write</AttributeValue>
</Attribute>
</Attributes>
</Result>
<Result>
<Decision>Permit</Decision>
<Status>
<StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/>
</Status>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">write</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">foo1</AttributeValue>
</Attribute>
</Attributes>
</Result>
<Result>
<Decision>Permit</Decision>
<Status>
<StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/>
</Status>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">write</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">foo1</AttributeValue>
</Attribute>
</Attributes>
<Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="true">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">foo2</AttributeValue>
</Attribute>
</Attributes>
</Result>
</Response>
From this XACML Response i got four Result decisions as Permit ,
First Result decision is Permit and it means foo1 and foo2 resources can be READ by the user bob2 .
Second Result decision is Permit and it means foo2 resource can be READ and WRITE by the user bob2.
Third Result decision is Permit and it means foo1 resource can be READ and WRITE by the user bob2.
Fourth Result decision is Permit and it means foo1 and foo2 resources can be WRITE by the user bob2.
This is how i understood from the XACML response.Do you think my understanding is correct ? If not Please guide me how to understand the XACML Response.
I assume, you are trying the multiple decision profile with XACML 3.0. Yes you are correct. However, your given XACML request is not the correct one to provide abovr result. Therefore it is great to update it. Normally, when multiple decision profile is used, you can receive more than one results. As an example, you can as authorization for read and write actions for same request as you have done. Then XACML response contains two results. I guess you can fine more details about multiple decision profile from here

VersionOne rest API description attribute format

Successfully using the VersionOne API to create stories using the REST API. Unfortunately the description field seems to strip all xml tags. (The example online uses , but this does not work)
So have something like:
POST /VersionOne/rest-1.v1/Data/Story HTTP/1.1
Content-Type: text/xml; charset=utf-8
Content-Length: 221
<Asset>
<Attribute name="Name" act="set">New Story</Attribute>
<Relation name="Scope" act="set">
<Asset idref="Scope:0" />
</Relation>
<Attribute name="Description" act="set">
<p>first line</p>
<p> second line</p>
</Attribute>
</Asset>
Any way to insert formatting? Basically we are using this as a story to test our recently created artifact and want to refer to the defects/stories that are included in the artifact. Any help much appreciated, thanks.
Jon, you'll need to XML-encode the text value of Description. Two possibilities are:
<Asset>
<Attribute name="Name" act="set">New Story</Attribute>
<Relation name="Scope" act="set">
<Asset idref="Scope:0" />
</Relation>
<Attribute name="Description" act="set">
<p>first line</p>
<p> second line</p>
</Attribute>
</Asset>
or
<Asset>
<Attribute name="Name" act="set">New Story</Attribute>
<Relation name="Scope" act="set">
<Asset idref="Scope:0" />
</Relation>
<Attribute name="Description" act="set"><![CDATA[
<p>first line</p>
<p> second line</p>
]]></Attribute>
</Asset>
You could try to use CDATA sections, like this:
<Asset>
<Attribute name="Description" act="set">
<![CDATA[
<xml>code goes here</xml>
]]>
</Attribute>
</Asset>
When I do this against our public test server: https://www14.v1host.com/v1sdktesting/http.html, and POST to the default Scope/0, I get this:
<?xml version="1.0" encoding="UTF-8"?>
<Asset href="/v1sdktesting/rest-1.v1/Data/Scope/0/21470" id="Scope:0:21470">
<Attribute name="Description"><xml>code goes here</xml> </Attribute>
</Asset>
Does this help?