Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT Conversion 1

Status
Not open for further replies.

dkwaters

Programmer
Feb 16, 2003
17
0
0
GB
Hi,

I am trying to convert the XML below:

<?xml version="1.0" encoding="utf-8" ?>
- <string xmlns="- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <datareader>
- <_x0031_088 diffgr:id="10881" msdata:rowOrder="0" diffgr:hasChanges="inserted">
<UserName>USERNAME</UserName>
<Password>PASSWORD</Password>
<Event_ID>17791</Event_ID>
<Spirit_ID>36212</Spirit_ID>
<EstablishmentFullName>Ley Top Primary School</EstablishmentFullName>
<Postcode>BD15 7PQ</Postcode>
<Type_ID>20</Type_ID>
<Sub_Type>A: Closed - No Sale</Sub_Type>
<UserName1>Rosemary Glave</UserName1>
<StartDate>13/May/2004 00:00:00</StartDate>
<Due_Date>25/May/2004 00:00:00</Due_Date>
<Status>F</Status>
<Event_Name>KB PROSPECT</Event_Name>
<ActionDate />
<ActionUser>72</ActionUser>
<ActionNarrative />
<ActionTypeID>15</ActionTypeID>
</_x0031_088>
- <_x0031_088 diffgr:id="10882" msdata:rowOrder="1" diffgr:hasChanges="inserted">
<UserName>USERNAME</UserName>
<Password>PASSWORD</Password>
<Event_ID>17791</Event_ID>
<Spirit_ID>36212</Spirit_ID>
<EstablishmentFullName>Ley Top Primary School</EstablishmentFullName>
<Postcode>BD15 7PQ</Postcode>
<Type_ID>20</Type_ID>
<Sub_Type>A: Closed - No Sale</Sub_Type>
<UserName1>Rosemary Glave</UserName1>
<StartDate>13/May/2004 00:00:00</StartDate>
<Due_Date>25/May/2004 00:00:00</Due_Date>
<Status>F</Status>
<Event_Name>KB PROSPECT</Event_Name>
<ActionDate>2004-05-13T17:53:31.85+01:00</ActionDate>
<ActionUser>72</ActionUser>
<ActionNarrative>Lead reallocated by to</ActionNarrative>
<ActionTypeID>16</ActionTypeID>
</_x0031_088>
- <_x0031_088 diffgr:id="10883" msdata:rowOrder="2" diffgr:hasChanges="inserted">
<UserName>USERNAME</UserName>
<Password>PASSWORD</Password>
<Event_ID>17791</Event_ID>
<Spirit_ID>36212</Spirit_ID>
<EstablishmentFullName>Ley Top Primary School</EstablishmentFullName>
<Postcode>BD15 7PQ</Postcode>
<Type_ID>20</Type_ID>
<Sub_Type>A: Closed - No Sale</Sub_Type>
<UserName1>Rosemary Glave</UserName1>
<StartDate>13/May/2004 00:00:00</StartDate>
<Due_Date>25/May/2004 00:00:00</Due_Date>
<Status>F</Status>
<Event_Name>KB PROSPECT</Event_Name>
<ActionDate>2004-05-14T08:35:22+01:00</ActionDate>
<ActionUser>88</ActionUser>
<ActionNarrative>Couldnt get put through. Have left detailed message and will call back if intereste</ActionNarrative>
<ActionTypeID>1</ActionTypeID>
</_x0031_088>
- <_x0031_088 diffgr:id="10884" msdata:rowOrder="3" diffgr:hasChanges="inserted">
<UserName>USERNAME</UserName>
<Password>PASSWORD</Password>
<Event_ID>17791</Event_ID>
<Spirit_ID>36212</Spirit_ID>
<EstablishmentFullName>Ley Top Primary School</EstablishmentFullName>
<Postcode>BD15 7PQ</Postcode>
<Type_ID>20</Type_ID>
<Sub_Type>A: Closed - No Sale</Sub_Type>
<UserName1>Rosemary Glave</UserName1>
<StartDate>13/May/2004 00:00:00</StartDate>
<Due_Date>25/May/2004 00:00:00</Due_Date>
<Status>F</Status>
<Event_Name>KB PROSPECT</Event_Name>
<ActionDate>2004-05-21T08:20:44.533+01:00</ActionDate>
<ActionUser>72</ActionUser>
<ActionNarrative>Lead re-allocated by Dawn Jeffries to</ActionNarrative>
<ActionTypeID>16</ActionTypeID>
</_x0031_088>
- <_x0031_088 diffgr:id="10885" msdata:rowOrder="4" diffgr:hasChanges="inserted">
<UserName>USERNAME</UserName>
<Password>PASSWORD</Password>
<Event_ID>17791</Event_ID>
<Spirit_ID>36212</Spirit_ID>
<EstablishmentFullName>Ley Top Primary School</EstablishmentFullName>
<Postcode>BD15 7PQ</Postcode>
<Type_ID>20</Type_ID>
<Sub_Type>A: Closed - No Sale</Sub_Type>
<UserName1>Rosemary Glave</UserName1>
<StartDate>13/May/2004 00:00:00</StartDate>
<Due_Date>25/May/2004 00:00:00</Due_Date>
<Status>F</Status>
<Event_Name>KB PROSPECT</Event_Name>
<ActionDate>2004-05-26T14:02:54.84+01:00</ActionDate>
<ActionUser>72</ActionUser>
<ActionNarrative>Lead re-allocated by Dawn Jeffries to Rosemary Glave</ActionNarrative>
<ActionTypeID>16</ActionTypeID>
</_x0031_088>
- <_x0031_088 diffgr:id="10886" msdata:rowOrder="5" diffgr:hasChanges="inserted">
<UserName>USERNAME</UserName>
<Password>PASSWORD</Password>
<Event_ID>18532</Event_ID>
<Spirit_ID>36212</Spirit_ID>
<EstablishmentFullName>Ley Top Primary School</EstablishmentFullName>
<Postcode>BD15 7PQ</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Mark Booth</UserName1>
<StartDate>13/May/2004 00:00:00</StartDate>
<Due_Date>30/Apr/2004 00:00:00</Due_Date>
<Priority>2</Priority>
<Status>A</Status>
<Event_Name>KnowledgeBox Pipeline Prospect</Event_Name>
<ActionDate>2003-11-17T00:00:00+00:00</ActionDate>
<ActionUser>21</ActionUser>
<ActionNarrative>Last demo:17-Nov-03</ActionNarrative>
<ActionTypeID>21</ActionTypeID>
</_x0031_088>
- <_x0031_088 diffgr:id="10887" msdata:rowOrder="6" diffgr:hasChanges="inserted">
<UserName>USERNAME</UserName>
<Password>PASSWORD</Password>
<Event_ID>37040</Event_ID>
<Spirit_ID>36212</Spirit_ID>
<EstablishmentFullName>Ley Top Primary School</EstablishmentFullName>
<Postcode>BD15 7PQ</Postcode>
<Type_ID>28</Type_ID>
<Sub_Type>A: Marketing Activity - Completed</Sub_Type>
<UserName1>Alex Wilkinson</UserName1>
<Status>F</Status>
<Event_Name>Summer Term Offer</Event_Name>
<ActionDate>2004-06-18T00:00:00+01:00</ActionDate>
<ActionUser>53</ActionUser>
<ActionTypeID>9</ActionTypeID>
</_x0031_088>
- <_x0031_088 diffgr:id="10888" msdata:rowOrder="7" diffgr:hasChanges="inserted">
<UserName>USERNAME</UserName>
<Password>PASSWORD</Password>
<Event_ID>78466</Event_ID>
<Spirit_ID>36212</Spirit_ID>
<EstablishmentFullName>Ley Top Primary School</EstablishmentFullName>
<Postcode>BD15 7PQ</Postcode>
<Type_ID>28</Type_ID>
<Sub_Type>A: Marketing Activity - Completed</Sub_Type>
<UserName1>Jo Dieguez</UserName1>
<Status>F</Status>
<Event_Name>MathsWorks Teaser ED05-100a/b/c</Event_Name>
<ActionDate>2005-04-15T00:00:00+01:00</ActionDate>
<ActionUser>54</ActionUser>
<ActionTypeID>9</ActionTypeID>
</_x0031_088>
- <_x0031_088 diffgr:id="10889" msdata:rowOrder="8" diffgr:hasChanges="inserted">
<UserName>USERNAME</UserName>
<Password>PASSWORD</Password>
<Event_ID>86646</Event_ID>
<Spirit_ID>36212</Spirit_ID>
<EstablishmentFullName>Ley Top Primary School</EstablishmentFullName>
<Postcode>BD15 7PQ</Postcode>
<Type_ID>28</Type_ID>
<Sub_Type>A: Marketing Activity - Completed</Sub_Type>
<UserName1>Penelope Beech</UserName1>
<Status>F</Status>
<Event_Name>Digitexts April Offer Campaign 05</Event_Name>
<ActionDate>2005-04-19T00:00:00+01:00</ActionDate>
<ActionUser>55</ActionUser>
<ActionTypeID>9</ActionTypeID>
</_x0031_088>
</datareader>
</diffgr:diffgram>
</string>

To one of this format..

<WS1088>
<WS1088_Result diffgr:id="WS1088_Result1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
<uname>spirit_sys</uname>
<password>Gh05t5ly</password>
</WS1088_Result>
<WS1088_Results diffgr:id="WS1088_Results1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
<Event_ID>35375</Event_ID>
<Spirit_ID>32949</Spirit_ID>
<KB_ID>1378</KB_ID>
<EstablishmentName>Selsdon Primary School</EstablishmentName>
<Postcode>CR2 8LQ</Postcode>
<StatusID>28</StatusID>
<Sub_TypeID>A: Marketing Activity Completed</Sub_TypeID>
<UserName>spirit_sys</UserName>
<StartDate>18/Jun/2004 00:00:00</StartDate>
<Due_Date>29/Aug/2006 00:00:00</Due_Date>
<Status>F</Status>
<Event_Name>Summer Term Offer</Event_Name>
<CallHistory>
<Call>
<DateTime>29/Aug/2006 00:00:00</DateTime>
<User>Shelley Stanton</User>
<Action>Telephone Call Out Bound</Action>
<Note>Checked - they want it all.</Note>
</Call>
</CallHistory>
</WS1088_Results>
<WS1088_Results diffgr:id="WS1088_Results2" msdata:rowOrder="1" diffgr:hasChanges="inserted">
<Event_ID>53389</Event_ID>
<Spirit_ID>32949</Spirit_ID>
<KB_ID>1378</KB_ID>
<EstablishmentName>Selsdon Primary School</EstablishmentName>
<Postcode>CR2 8LQ</Postcode>
<StatusID>13</StatusID>
<Sub_TypeID>A: Closed Sale Made</Sub_TypeID>
<UserName>spirit_sys</UserName>
<StartDate>14/Feb/2005 12:00:00</StartDate>
<Due_Date>14/Sep/2005 12:00:00</Due_Date>
<Status>F</Status>
<Event_Name>lead from BETT</Event_Name>
<CallHistory>
<Call>
<DateTime>14/Sep/2005 12:00:00</DateTime>
<User>Shelley Stanton</User>
<Action>Telephone Call Out Bound</Action>
<Note>left msg regarding upgrade - yet again</Note>
</Call>
<Call>
<DateTime>12/Sep/2005 12:00:00</DateTime>
<User>Shelley Stanton</User>
<Action>Telephone Call Out Bound</Action>
<Note>left msg regarding upgrade - again</Note>
</Call>
<Call>
<DateTime>10/Sep/2005 12:00:00</DateTime>
<User>Shelley Stanton</User>
<Action>Telephone Call Out Bound</Action>
<Note>left msg regarding upgrade</Note>
</Call>
</CallHistory>
</WS1088_Results>
...
</WS1088>
</diffgr:diffgram>
</string>



Basically the EVENT_ID element forms a group, then there is a loop within the group.

I have spent ages trying to write the XSLT for this and it is driving me mad. Any help would be appreciated.
 
XSLT can take a while to learn, but probably we can help find your problem.

Please post your XSLT so far. What seems to be going wrong? Please reduce the sample input to match the sample output.

Also, it would be easier to use your sample input, output and XSLT if you place them in [ignore]
Code:
...
[/ignore]
TGML tags (click on the 'Process TGML' link below for more detail. When posting XML documents, please post them as plain text, rather than including the formatting added by IE (those hyphens interspersed on the left side in your original post input document).

I know this request is coming after you have spent ages, and are frustrated, but by doing so, you will make it far more easy to provide some help. Certainly if you have spent ages, it would be great to help you resolve your issue(s) so you can focus on what your goal is (assuming your goal was not learning XSLT).

Tom Morrison
 
Thanks! I can't get at the XSLT at the moment so I'll post it tomorrow. I appreciate the response.
 
Hi,

The XSL I have to Date is:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=" version="2.0"
xmlns:edu=" exclude-result-prefixes="edu"
xmlns=" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
>
<xsl:eek:utput indent="yes"/>
<xsl:key name="x0031-by-eventID" match="edu:_x0031_088" use="edu:Event_ID"/>
<xsl:template match="edu:string">
<result>
<xsl:for-each select="//edu:_x0031_088[generate-id() = generate-id(key('x0031-by-eventID', edu:Event_ID)[1])]">
<event>
<xsl:copy-of select="edu:UserName | edu:password | edu:Event_ID | edu:Spirit_ID | edu:EstablishmentFullName | edu:postcode | edu:Type_ID | edu:Sub_Type | edu:UserName1 | edu:Status"/>
<CallHistory>
<xsl:for-each select="key('x0031-by-eventID', edu:Event_ID)">
<Call>
<xsl:copy-of select="*[starts-with(local-name(), 'Action')]"/>
</Call>
</xsl:for-each>
</CallHistory>
</event>
</xsl:for-each>
</result>
</xsl:template>
</xsl:stylesheet>


Then the XML should turn this:

<?xml version="1.0" standalone="yes"?>
<datareader>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>43687</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Jason Gould</UserName1>
<StartDate>30/Aug/2004 00:00:00</StartDate>
<Due_Date>01/Sep/2004 00:00:00</Due_Date>
<Priority>1</Priority>
<Status>A</Status>
<Event_Name>TEST</Event_Name>
<ActionDate>2004-09-01T00:00:00+01:00</ActionDate>
<ActionUser>2</ActionUser>
</_x0031_088>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>43687</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Jason Gould</UserName1>
<StartDate>30/Aug/2004 00:00:00</StartDate>
<Due_Date>01/Sep/2004 00:00:00</Due_Date>
<Priority>1</Priority>
<Status>A</Status>
<Event_Name>TEST</Event_Name>
<ActionDate>2004-10-01T00:00:00+01:00</ActionDate>
<ActionUser>3</ActionUser>
</_x0031_088>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>43687</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Jason Gould</UserName1>
<StartDate>30/Aug/2004 00:00:00</StartDate>
<Due_Date>01/Sep/2004 00:00:00</Due_Date>
<Priority>1</Priority>
<Status>A</Status>
<Event_Name>TEST</Event_Name>
<ActionDate>2004-11-01T00:00:00+01:00</ActionDate>
<ActionUser>4</ActionUser>
</_x0031_088>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>43687</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Jason Gould</UserName1>
<StartDate>30/Aug/2004 00:00:00</StartDate>
<Due_Date>01/Sep/2004 00:00:00</Due_Date>
<Priority>1</Priority>
<Status>A</Status>
<Event_Name>TEST</Event_Name>
<ActionDate>2004-12-30T11:31:26+01:00</ActionDate>
<ActionUser>5</ActionUser>
</_x0031_088>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>43687</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Jason Gould</UserName1>
<StartDate>30/Aug/2004 00:00:00</StartDate>
<Due_Date>01/Sep/2004 00:00:00</Due_Date>
<Priority>1</Priority>
<Status>A</Status>
<Event_Name>TEST</Event_Name>
<ActionDate>2004-01-30T11:31:26+01:00</ActionDate>
<ActionUser>6</ActionUser>
</_x0031_088>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>43687</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Jason Gould</UserName1>
<StartDate>30/Aug/2004 00:00:00</StartDate>
<Due_Date>01/Sep/2004 00:00:00</Due_Date>
<Priority>1</Priority>
<Status>A</Status>
<Event_Name>TEST</Event_Name>
<ActionDate>2004-08-30T11:31:26+01:00</ActionDate>
<ActionUser>3</ActionUser>
</_x0031_088>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>43687</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Jason Gould</UserName1>
<StartDate>30/Aug/2004 00:00:00</StartDate>
<Due_Date>01/Sep/2004 00:00:00</Due_Date>
<Priority>1</Priority>
<Status>A</Status>
<Event_Name>TEST</Event_Name>
<ActionDate>2004-08-30T11:31:46+01:00</ActionDate>
<ActionUser>2</ActionUser>
</_x0031_088>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>47718</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Sandie May</UserName1>
<StartDate>21/Oct/2004 10:00:00</StartDate>
<Due_Date>09/Nov/2004 10:00:00</Due_Date>
<Status>A</Status>
<Event_Name>tam appt</Event_Name>
<ActionDate>2004-11-09T10:00:00+00:00</ActionDate>
<ActionUser>32</ActionUser>
</_x0031_088>
</datareader>

Into

<?xml version="1.0" standalone="yes"?>
<datareader>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>43687</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Jason Gould</UserName1>
<StartDate>30/Aug/2004 00:00:00</StartDate>
<Due_Date>01/Sep/2004 00:00:00</Due_Date>
<Priority>1</Priority>
<Status>A</Status>
<Event_Name>TEST</Event_Name>
<CallHistory>
<Call>
<ActionDate>2004-09-01T00:00:00+01:00</ActionDate>
<ActionUser>2</ActionUser>
</Call>
<Call>
<ActionDate>2004-10-01T00:00:00+01:00</ActionDate>
<ActionUser>3</ActionUser>
</Call>
<Call>
<ActionDate>2004-11-01T11:31:26+01:00</ActionDate>
<ActionUser>4</ActionUser>
</Call>
<Call>
<ActionDate>2004-12-30T11:31:26+01:00</ActionDate>
<ActionUser>5</ActionUser>
</Call>
<Call>
<ActionDate>2004-01-30T11:31:26+01:00</ActionDate>
<ActionUser>6</ActionUser>
</Call>
<Call>
<ActionDate>2004-08-30T11:31:26+01:00</ActionDate>
<ActionUser>3</ActionUser>
</Call>
</CallHistory>
</_x0031_088>
<_x0031_088>
<UserName>uname</UserName>
<Password>pword</Password>
<Event_ID>47718</Event_ID>
<Spirit_ID>17219</Spirit_ID>
<EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
<Postcode>DA12 2PR</Postcode>
<Type_ID>10</Type_ID>
<Sub_Type>A: Active</Sub_Type>
<UserName1>Sandie May</UserName1>
<StartDate>21/Oct/2004 10:00:00</StartDate>
<Due_Date>09/Nov/2004 10:00:00</Due_Date>
<Status>A</Status>
<Event_Name>tam appt</Event_Name>
<ActionDate>2004-11-09T10:00:00+00:00</ActionDate>
<ActionUser>32</ActionUser>
</_x0031_088>
</datareader>


NOTE: The call element shows the data that has changed against each Event_ID


I am doing the ocnversion using visula studio 2005 in Visual Basic, my code to convert the code is:

Dim XML As New XPathDocument(XMLDOCPATH)
XSLT.Load(XSLTDOCPATH)
Dim fstream As New System.IO.FileStream(XMLDOCPATH, IO.FileMode.Create)
XSLT.Transform(XML, Nothing, fstream)
fstream.Close()

thanks again for your time!
 
For starters, what is this supposed to match?
Code:
    <xsl:template match="edu:string">

The entire output of your translation is the result built-in templates. You may read about built-in templates here.

Also, I see that your stylesheet makes extensive use of namespaces, but there are no namespace declarations in the source document. Remember that matching requires both the local-name and namespace of an element to be equal.

Tom Morrison
 
Okay. I made the following change to the stylesheet.
Code:
    <xsl:key name="x0031-by-eventID" match="edu:_x0031_088" use="edu:Event_ID"/>

    [COLOR=red]<xsl:template match="/">[/color]
        <result>
            <xsl:for-each select="//edu:_x0031_088[generate-id() = generate-id(key('x0031-by-eventID', edu:Event_ID)[1])]">
                <event>

And, I added a namespace declaration to the input XML document.
Code:
<?xml version="1.0" standalone="yes"?>
<datareader     [COLOR=red]xmlns="[URL unfurl="true"]http://education.co"[/URL][/color]>
	<_x0031_088>
		<UserName>uname</UserName>
		<Password>pword</Password>

And I got a document output that is almost what you want. I think you can determine what you need to do from here, but if you have more questions, feel free to ask. :-D
Code:
<?xml version='1.0' ?>
<result xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns="[URL unfurl="true"]http://education.co">[/URL]
  <event>
    <UserName>uname</UserName>
    <Password>pword</Password>
    <Event_ID>43687</Event_ID>
    <Spirit_ID>17219</Spirit_ID>
    <EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
    <Postcode>DA12 2PR</Postcode>
    <Type_ID>10</Type_ID>
    <Sub_Type>A: Active</Sub_Type>
    <UserName1>Jason Gould</UserName1>
    <Status>A</Status>
    <CallHistory>
      <Call>
        <ActionDate>2004-09-01T00:00:00+01:00</ActionDate>
        <ActionUser>2</ActionUser>
      </Call>
      <Call>
        <ActionDate>2004-10-01T00:00:00+01:00</ActionDate>
        <ActionUser>3</ActionUser>
      </Call>
      <Call>
        <ActionDate>2004-11-01T00:00:00+01:00</ActionDate>
        <ActionUser>4</ActionUser>
      </Call>
      <Call>
        <ActionDate>2004-12-30T11:31:26+01:00</ActionDate>
        <ActionUser>5</ActionUser>
      </Call>
      <Call>
        <ActionDate>2004-01-30T11:31:26+01:00</ActionDate>
        <ActionUser>6</ActionUser>
      </Call>
      <Call>
        <ActionDate>2004-08-30T11:31:26+01:00</ActionDate>
        <ActionUser>3</ActionUser>
      </Call>
      <Call>
        <ActionDate>2004-08-30T11:31:46+01:00</ActionDate>
        <ActionUser>2</ActionUser>
      </Call>
    </CallHistory>
  </event>
  <event>
    <UserName>uname</UserName>
    <Password>pword</Password>
    <Event_ID>47718</Event_ID>
    <Spirit_ID>17219</Spirit_ID>
    <EstablishmentFullName>Gravesend Grammar School</EstablishmentFullName>
    <Postcode>DA12 2PR</Postcode>
    <Type_ID>10</Type_ID>
    <Sub_Type>A: Active</Sub_Type>
    <UserName1>Sandie May</UserName1>
    <Status>A</Status>
    <CallHistory>
      <Call>
        <ActionDate>2004-11-09T10:00:00+00:00</ActionDate>
        <ActionUser>32</ActionUser>
      </Call>
    </CallHistory>
  </event>
</result>

Tom Morrison
 
That worked a treat. Thank you ever so much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top