Re: help with html table (nested for-each/keys/matched template)



rick wrote:

> code them. I recognize that the xml structure is a little awkward but
> that's what I have to work with. Thanks in advance for any
> suggestions.

You dont need XSL for such a trivial data extraction.
The following script in xmlgawk will do all the data
extraction described:

BEGIN { XMLMODE=1 }
XMLCHARDATA { data = $0 }
XMLENDELEM == "displayName" { name = data }
XMLENDELEM == "uri" { uri[name] = data }
XMLENDELEM == "resource_description" { split(data, d); dsc[d[1]] = data }

END {
for (n in uri) {
print uri[n] "\t" n "\t" dsc[n]
}
}

When running the script, you will get the result:

gawk -lxml -f artifact.awk artifact.xml
location of file1 file1.doc file1.doc
description
location of file2 file2.doc file2.doc
description

Notice the line break in the output, which are caused by
your XML data. By the way, there is a bug in your XML data.

> <artifact>
> <file_name>file2.doc</file_name>
> <resource_description>file1.doc
here: ^^^^^^^^
> description</resource_description>
> </artifact>
.



Relevant Pages

  • Importing XML through .NET Web Service with VBA
    ... I need some guidance regarding importing XML data through .NET Web ... I currently have a spreadsheet that utilizes external ... My solution is to setup a .NET Web Service that makes the calls ...
    (microsoft.public.excel.programming)
  • xml script
    ... Can anybody help me with this script. ... I have a script that read xml data, but i get a error in the For each ... ' Create an XML Document Object and specify XPath ... Dim oNode: Set oNode = oXDoc.selectSingleNode ...
    (microsoft.public.scripting.vbscript)
  • RE: Can I extract a XSLT from a Word DOcument?
    ... Thank you Stephanie. ... I heard about Smart Docs as I hear about a lot of things ... provides XML which has to go into a document. ... to create the XML data in our Doc Creation App ...
    (microsoft.public.word.vba.general)
  • Re: byte array problem
    ... Kevin thanks alot for your help. ... They will be using a .net program to post the xml data with the web browser ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Getting XML body and context from tracking
    ... The question on how to get hold of the XML data from tracking database ... Niriven answered on how to decompress the actual message body from the ... method (I've pasted the exception for everyone to read). ...
    (microsoft.public.biztalk.general)