Re: [WebDNA] XML Parser

This WebDNA talk-list message is from

2016


It keeps the original formatting.
numero = 113136
interpreted = N
texte = 724 --001a11412a068fa8c7054051390f Content-Type: text/plain; charset=UTF-8 Gary, Hi - just use the built-in XML parser. Example below to pull out the HostName. You'll need to isolate each into it's own xmlparse variable. - Tom [xmlparse var=xml_var1] OP2 Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz 3.201 4 64 Microsoft Windows 7 Professional 3 860 Intel(R) HD Graphics 1 4.5.2 or later 2016-09-30 17:55:03 False 100 No Plugin Installed [/xmlparse] [xmlnode ref=xml_var1&path=named:Workstation/HostName][name]=[value][/xmlnode] ============================================== Digital Revolutionaries 1st Floor, Castleriver House 14-15 Parliament Street Temple Bar,Dublin 2 Ireland ---------------------------------------------- [t]: + 353 1 4403907 [e]: [w]: ============================================== On 2 November 2016 at 12:53, Gary Krockover wrote: > Hey folks! I hope that everybody is doing well, it's been a while (again). > > > > I've got a little project that I volunteered for at work and that is to > make sense of some XML that is gathered on PC workstations for our sales > team so that they can present the findings (for compatibility reasons) to > clients. Before I began the project, I thought I'd ask you fine folks if > anybody has some ready-made XML parsing scripts already created that I > could perhaps borrow or purchase? Thought it'd save some time though I'm > sure that I could stumble through it if nothing is ready made. > > > > For reference, the XML is simple and is saved to a file with output such > as: > > > > > > OP2 > > Intel(R) Core(TM) i5-3470 CPU @ > 3.20GHz > > 3.201 > > 4 > > 64 > > Microsoft Windows 7 Professional > > 3 > > 860 > > Intel(R) HD Graphics > > 1 > > 4.5.2 or later > > 2016-09-30 17:55:03 > > False > > 100 > > > > > > No Plugin Installed > > > > > > > > > > OP4 > > Intel(R) Core(TM) i5-4590 CPU @ > 3.30GHz > > .....etc > > > > Feel free to email if you prefer or if there's some tips from the pro's. > I imagine a lot of [listwords] commands being used here- > > > > Thanks! > Gary > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: http://mail.webdna.us/list/ > talk@webdna.us Bug Reporting: support@webdna.us --001a11412a068fa8c7054051390f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Gary,

Hi - just use the built-in XML pa= rser.=C2=A0 Example below to pull out the HostName.

You'll need to isolate each <Workstation> into it's own xml= parse variable.

- Tom

[xmlparse var=3Dxml_var1]
=C2=A0 <Workstation= >
=C2=A0 =C2=A0 =C2=A0 <HostName>OP2</HostName>
=C2=A0 =C2=A0 =C2=A0 <Processorname>Intel(R) Core(TM) i5-3470= CPU @ 3.20GHz</Processorname>
=C2=A0 =C2=A0 =C2=A0 <Pro= cessorSpeed>3.201</ProcessorSpeed>
=C2=A0 =C2=A0 =C2=A0 = <ProcessorCores>4</ProcessorCores>
=C2=A0 =C2=A0 =C2= =A0 <Architecture>64</Architecture>
=C2=A0 =C2=A0 =C2= =A0 <OperatingSystem>Microsoft Windows 7 Professional </OperatingS= ystem>
=C2=A0 =C2=A0 =C2=A0 <Ram>3</Ram>
=C2=A0 =C2=A0 =C2=A0 <FreeSpace>860</FreeSpace>
=C2= =A0 =C2=A0 =C2=A0 <GraphicsCard>Intel(R) HD Graphics</GraphicsCard= >
=C2=A0 =C2=A0 =C2=A0 <GraphicsMemoryinGB>1</Graphic= sMemoryinGB>
=C2=A0 =C2=A0 =C2=A0 <DotNetVersion>4.5.2 o= r later</DotNetVersion>
=C2=A0 =C2=A0 =C2=A0 <LastWindow= sUpdate>2016-09-30 17:55:03</LastWindowsUpdate>
=C2=A0 = =C2=A0 =C2=A0 <IsVirtualMachine>False</IsVirtualMachine>
<= div>=C2=A0 =C2=A0 =C2=A0 <LANSpeed>100</LANSpeed>
=C2= =A0 =C2=A0 =C2=A0 <CurrentSidexisVersion>
=C2=A0 =C2=A0 =C2= =A0 </CurrentSidexisVersion>
=C2=A0 =C2=A0 =C2=A0 <Imagi= ngPluginType>No Plugin Installed</ImagingPluginType>
=C2= =A0 =C2=A0 =C2=A0 <PluginVersion>
=C2=A0 =C2=A0 =C2=A0 <= /PluginVersion>
=C2=A0 =C2=A0 </Workstation>
[= /xmlparse]

[xmlnode ref=3Dxml_var1&path=3Dname= d:Workstation/HostName][name]=3D[value][/xmlnode]






=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Digital Revolutionaries
1s= t Floor, Castleriver House
14-15 Parliament Street
Temple Bar,Dublin = 2
Ireland
----------------------------------------------
[t]: + 35= 3 1 4403907
[e]: <mailto:tom@revolutionaries.ie>
[w]: <http://www.revolutionaries.ie/= >
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

On 2 November 2016 at 12:53, Gary Krockover = <gary@garykrockover.com> wrote:

Hey folks!=C2=A0 I hope that everybody is doing well= , it's been a while (again).

=C2=A0

I've got a little project that I volunteered for= at work and that is to make sense of some XML that is gathered on PC workstations for o= ur sales team so that they can present the findings (for compatibility reasons= ) to clients.=C2=A0 Before I began the project, I thought I'd ask you fine f= olks if anybody has some ready-made XML parsing scripts already created that I coul= d perhaps borrow or purchase?=C2=A0 Thought it'd save some time though I&= #39;m sure that I could stumble through it if nothing is ready made.

=C2=A0

For reference, the XML is simple and is saved to a f= ile with output such as:

=C2=A0

=C2=A0=C2=A0=C2=A0 <Workstation>=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <HostName>OP2&l= t;/HostName>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Processorname>= Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz</Processorname>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <ProcessorSpeed>= ;3.201</ProcessorSpeed>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <ProcessorCores>= ;4</ProcessorCores>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Architecture>6= 4</Architecture>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <OperatingSystem&g= t;Microsoft Windows 7 Professional </OperatingSystem>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Ram>3</Ram&= gt;

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <FreeSpace>860&= lt;/FreeSpace>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <GraphicsCard>I= ntel(R) HD Graphics</GraphicsCard>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <GraphicsMemoryinG= B>1</GraphicsMemoryinGB>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <DotNetVersion>= 4.5.2 or later</DotNetVersion>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <LastWindowsUpdate= >2016-09-30 17:55:03</LastWindowsUpdate>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <IsVirtualMachine&= gt;False</IsVirtualMachine>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <LANSpeed>100&l= t;/LANSpeed>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <CurrentSidexisVer= sion>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </CurrentSidexisVe= rsion>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <ImagingPluginType= >No Plugin Installed</ImagingPluginType>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <PluginVersion>=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </PluginVersion>= ;

=C2=A0=C2=A0=C2=A0 </Workstation>

=C2=A0=C2=A0=C2=A0 <Workstation>=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <HostName>OP4&l= t;/HostName>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Processorname>= Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz</Processorname>

.....etc

=C2=A0

Feel free to email if you prefer or if there's s= ome tips from the pro's.=C2=A0 I imagine a lot of [listwords] commands being use= d here-

=C2=A0

Thanks!
Gary

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us --001a11412a068fa8c7054051390f-- . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] XML Parser (Michael Davis 2016)
  2. Re: [WebDNA] XML Parser (christophe.billiottet@webdna.us 2016)
  3. Re: [WebDNA] XML Parser (Donovan Brooke 2016)
  4. Re: [WebDNA] XML Parser ("Gary Krockover" 2016)
  5. Re: [WebDNA] XML Parser (Tom Duke 2016)
  6. [WebDNA] XML Parser ("Gary Krockover" 2016)
724 --001a11412a068fa8c7054051390f Content-Type: text/plain; charset=UTF-8 Gary, Hi - just use the built-in XML parser. Example below to pull out the HostName. You'll need to isolate each into it's own xmlparse variable. - Tom [xmlparse var=xml_var1] OP2 Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz 3.201 4 64 Microsoft Windows 7 Professional 3 860 Intel(R) HD Graphics 1 4.5.2 or later 2016-09-30 17:55:03 False 100 No Plugin Installed [/xmlparse] [xmlnode ref=xml_var1&path=named:Workstation/HostName][name]=[value][/xmlnode] ============================================== Digital Revolutionaries 1st Floor, Castleriver House 14-15 Parliament Street Temple Bar,Dublin 2 Ireland ---------------------------------------------- [t]: + 353 1 4403907 [e]: [w]: ============================================== On 2 November 2016 at 12:53, Gary Krockover wrote: > Hey folks! I hope that everybody is doing well, it's been a while (again). > > > > I've got a little project that I volunteered for at work and that is to > make sense of some XML that is gathered on PC workstations for our sales > team so that they can present the findings (for compatibility reasons) to > clients. Before I began the project, I thought I'd ask you fine folks if > anybody has some ready-made XML parsing scripts already created that I > could perhaps borrow or purchase? Thought it'd save some time though I'm > sure that I could stumble through it if nothing is ready made. > > > > For reference, the XML is simple and is saved to a file with output such > as: > > > > > > OP2 > > Intel(R) Core(TM) i5-3470 CPU @ > 3.20GHz > > 3.201 > > 4 > > 64 > > Microsoft Windows 7 Professional > > 3 > > 860 > > Intel(R) HD Graphics > > 1 > > 4.5.2 or later > > 2016-09-30 17:55:03 > > False > > 100 > > > > > > No Plugin Installed > > > > > > > > > > OP4 > > Intel(R) Core(TM) i5-4590 CPU @ > 3.30GHz > > .....etc > > > > Feel free to email if you prefer or if there's some tips from the pro's. > I imagine a lot of [listwords] commands being used here- > > > > Thanks! > Gary > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: http://mail.webdna.us/list/ > talk@webdna.us Bug Reporting: support@webdna.us --001a11412a068fa8c7054051390f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Gary,

Hi - just use the built-in XML pa= rser.=C2=A0 Example below to pull out the HostName.

You'll need to isolate each <Workstation> into it's own xml= parse variable.

- Tom

[xmlparse var=3Dxml_var1]
=C2=A0 <Workstation= >
=C2=A0 =C2=A0 =C2=A0 <HostName>OP2</HostName>
=C2=A0 =C2=A0 =C2=A0 <Processorname>Intel(R) Core(TM) i5-3470= CPU @ 3.20GHz</Processorname>
=C2=A0 =C2=A0 =C2=A0 <Pro= cessorSpeed>3.201</ProcessorSpeed>
=C2=A0 =C2=A0 =C2=A0 = <ProcessorCores>4</ProcessorCores>
=C2=A0 =C2=A0 =C2= =A0 <Architecture>64</Architecture>
=C2=A0 =C2=A0 =C2= =A0 <OperatingSystem>Microsoft Windows 7 Professional </OperatingS= ystem>
=C2=A0 =C2=A0 =C2=A0 <Ram>3</Ram>
=C2=A0 =C2=A0 =C2=A0 <FreeSpace>860</FreeSpace>
=C2= =A0 =C2=A0 =C2=A0 <GraphicsCard>Intel(R) HD Graphics</GraphicsCard= >
=C2=A0 =C2=A0 =C2=A0 <GraphicsMemoryinGB>1</Graphic= sMemoryinGB>
=C2=A0 =C2=A0 =C2=A0 <DotNetVersion>4.5.2 o= r later</DotNetVersion>
=C2=A0 =C2=A0 =C2=A0 <LastWindow= sUpdate>2016-09-30 17:55:03</LastWindowsUpdate>
=C2=A0 = =C2=A0 =C2=A0 <IsVirtualMachine>False</IsVirtualMachine>
<= div>=C2=A0 =C2=A0 =C2=A0 <LANSpeed>100</LANSpeed>
=C2= =A0 =C2=A0 =C2=A0 <CurrentSidexisVersion>
=C2=A0 =C2=A0 =C2= =A0 </CurrentSidexisVersion>
=C2=A0 =C2=A0 =C2=A0 <Imagi= ngPluginType>No Plugin Installed</ImagingPluginType>
=C2= =A0 =C2=A0 =C2=A0 <PluginVersion>
=C2=A0 =C2=A0 =C2=A0 <= /PluginVersion>
=C2=A0 =C2=A0 </Workstation>
[= /xmlparse]

[xmlnode ref=3Dxml_var1&path=3Dname= d:Workstation/HostName][name]=3D[value][/xmlnode]






=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Digital Revolutionaries
1s= t Floor, Castleriver House
14-15 Parliament Street
Temple Bar,Dublin = 2
Ireland
----------------------------------------------
[t]: + 35= 3 1 4403907
[e]: <mailto:tom@revolutionaries.ie>
[w]: <http://www.revolutionaries.ie/= >
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

On 2 November 2016 at 12:53, Gary Krockover = <gary@garykrockover.com> wrote:

Hey folks!=C2=A0 I hope that everybody is doing well= , it's been a while (again).

=C2=A0

I've got a little project that I volunteered for= at work and that is to make sense of some XML that is gathered on PC workstations for o= ur sales team so that they can present the findings (for compatibility reasons= ) to clients.=C2=A0 Before I began the project, I thought I'd ask you fine f= olks if anybody has some ready-made XML parsing scripts already created that I coul= d perhaps borrow or purchase?=C2=A0 Thought it'd save some time though I&= #39;m sure that I could stumble through it if nothing is ready made.

=C2=A0

For reference, the XML is simple and is saved to a f= ile with output such as:

=C2=A0

=C2=A0=C2=A0=C2=A0 <Workstation>=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <HostName>OP2&l= t;/HostName>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Processorname>= Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz</Processorname>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <ProcessorSpeed>= ;3.201</ProcessorSpeed>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <ProcessorCores>= ;4</ProcessorCores>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Architecture>6= 4</Architecture>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <OperatingSystem&g= t;Microsoft Windows 7 Professional </OperatingSystem>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Ram>3</Ram&= gt;

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <FreeSpace>860&= lt;/FreeSpace>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <GraphicsCard>I= ntel(R) HD Graphics</GraphicsCard>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <GraphicsMemoryinG= B>1</GraphicsMemoryinGB>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <DotNetVersion>= 4.5.2 or later</DotNetVersion>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <LastWindowsUpdate= >2016-09-30 17:55:03</LastWindowsUpdate>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <IsVirtualMachine&= gt;False</IsVirtualMachine>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <LANSpeed>100&l= t;/LANSpeed>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <CurrentSidexisVer= sion>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </CurrentSidexisVe= rsion>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <ImagingPluginType= >No Plugin Installed</ImagingPluginType>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <PluginVersion>=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </PluginVersion>= ;

=C2=A0=C2=A0=C2=A0 </Workstation>

=C2=A0=C2=A0=C2=A0 <Workstation>=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <HostName>OP4&l= t;/HostName>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Processorname>= Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz</Processorname>

.....etc

=C2=A0

Feel free to email if you prefer or if there's s= ome tips from the pro's.=C2=A0 I imagine a lot of [listwords] commands being use= d here-

=C2=A0

Thanks!
Gary

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us --001a11412a068fa8c7054051390f-- . Tom Duke

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Re:Change WebDNA-Talk Mail due to no digest for 1wk (1997) Sorting error (1997) Signal Raised (1997) [WebDNA] (2010) unable to launch acgi in WebCat (1997) sort problems....bug or brain fart? (1997) b12 cannot limit records returned and more. (1997) Need relative path explanation (1997) Problem 2 of 2 (was: Shipping Confusion) (2000) READFILE command? (1998) AccountAuthorizer doesn't seem to work (1997) Locked files not [REPLACE APPEND=T]ed (2000) Character limit in [Search]? (1998) Limit on nested [ShowIf]'s? (1997) problem with NT beta (1997) Logging users (1998) possible, WebCat2.0 and checkboxes-restated (1997) Webcatalog server support (1997) Plugin or CGI or both (1997) FW: ANother SHOWIF problem (1997)