G
Gina_Marano
Please help. I don't have much hair left to pull out after struggling
over this into the wee hours of the morning.
I am having a tough time iterating through the following XML. I need
to evaluate each <Queue..> entry.
<?xml version="1.0" encoding="UTF-8"?>
<JMF xmlns="http://www.CIP4.org/JDFSchema_1_1" Version="1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Response ID="RDFS1934507113653e9" ReturnCode="0" Type="QueueStatus"
refID="132413dj323s223" xsi:type="ResponseQueueStatus">
<Queue DeviceID="Dev01" QueueSize="8" Status="Waiting">
<QueueEntry DeviceID="vl-5001" JobID="1048655" JobPartID="79">
<Preview URL="http://192.168.1.2/preview?job=1048655"/>
<JobPhase Amount="2000" DescriptiveName="12.jpg"
PercentCompleted="0"/>
</QueueEntry>
<QueueEntry DeviceID="Dev02" JobID="1048651" JobPartID="75">
<Preview URL="http://192.168.1.2/preview?job=1043654"/>
<JobPhase Amount="2000" DescriptiveName="13.jpg"
PercentCompleted="0"/>
</QueueEntry>
</Queue>
</Response>
</JMF>
(hopefully you can copy and paste it to a pretty editor)
XPathDocument xpathDocument = new XPathDocument(sFileName);
XPathNavigator xpathNavigator = xpathDocument.CreateNavigator();
XPathExpression xpathExpression = xpathNavigator.Compile("JMF/Response/
Queue/QueueEntry");
XPathNodeIterator xpathIterator =
xpathNavigator.Select(xpathExpression);
foreach (XPathNavigator node in xpathIterator)
{
string sID = node.GetAttribute("DeviceID", "");
...
}
Anything special I need to do since the XML has schema information in
it?
I also am not tied to XPathDocument but I need something efficient
because there can be hundreds of Queue "listings".
Any information would be extremely appreciated!
Good day y'all.
~Gina_M~
over this into the wee hours of the morning.
I am having a tough time iterating through the following XML. I need
to evaluate each <Queue..> entry.
<?xml version="1.0" encoding="UTF-8"?>
<JMF xmlns="http://www.CIP4.org/JDFSchema_1_1" Version="1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Response ID="RDFS1934507113653e9" ReturnCode="0" Type="QueueStatus"
refID="132413dj323s223" xsi:type="ResponseQueueStatus">
<Queue DeviceID="Dev01" QueueSize="8" Status="Waiting">
<QueueEntry DeviceID="vl-5001" JobID="1048655" JobPartID="79">
<Preview URL="http://192.168.1.2/preview?job=1048655"/>
<JobPhase Amount="2000" DescriptiveName="12.jpg"
PercentCompleted="0"/>
</QueueEntry>
<QueueEntry DeviceID="Dev02" JobID="1048651" JobPartID="75">
<Preview URL="http://192.168.1.2/preview?job=1043654"/>
<JobPhase Amount="2000" DescriptiveName="13.jpg"
PercentCompleted="0"/>
</QueueEntry>
</Queue>
</Response>
</JMF>
(hopefully you can copy and paste it to a pretty editor)
XPathDocument xpathDocument = new XPathDocument(sFileName);
XPathNavigator xpathNavigator = xpathDocument.CreateNavigator();
XPathExpression xpathExpression = xpathNavigator.Compile("JMF/Response/
Queue/QueueEntry");
XPathNodeIterator xpathIterator =
xpathNavigator.Select(xpathExpression);
foreach (XPathNavigator node in xpathIterator)
{
string sID = node.GetAttribute("DeviceID", "");
...
}
Anything special I need to do since the XML has schema information in
it?
I also am not tied to XPathDocument but I need something efficient
because there can be hundreds of Queue "listings".
Any information would be extremely appreciated!
Good day y'all.
~Gina_M~