S
Sculli
Guest
Alright, so I have this huge XML file (4MB, huge as far as XML goes anyway). It has some 5k entires, and I need to generate several HTML pages from it based on given parameters.
The kicker is, those pages need to be static. So I need to load the XML on my workstation, query it, generate the static output pages (probably around 400), and then upload them to the webserver. All in all pretty straight forward, except for the XML query.
It's been the devil to me. Then again, I never really had any prior run in with XML, but I spend like 6 hours today learning the basics and trying to figure this out.
What I need to do is generate one HTML page for each unique loc element, needless to say, there are very many duplicate ones.
Once I have a page for each loc, I need to list all proj elements grouped by fsc in decending order.
It would look something like this:
Trinidad (loc)
--2006 (fsc)
---- this A thingy (proj - alpha order)
---- this B thingy (proj - alpha order)
--2005
---- this A thingy (proj - alpha order)
---- this B thingy (proj - alpha order)
---- this C thingy (proj - alpha order)
etc etc
All I can say is GOOD GRIEF!
XQuery owns me today.
Any XQuery experts in here?
The kicker is, those pages need to be static. So I need to load the XML on my workstation, query it, generate the static output pages (probably around 400), and then upload them to the webserver. All in all pretty straight forward, except for the XML query.
It's been the devil to me. Then again, I never really had any prior run in with XML, but I spend like 6 hours today learning the basics and trying to figure this out.
Code:
<xs:element name="Table4">
<xs:complexType>
<xs:sequence>
<xs:element name="UID" msdata:ReadOnly="true" type="xs:string" minOccurs="0" />
<xs:element name="loc" type="xs:string" />
<xs:element name="NSFP" type="xs:string" minOccurs="0" />
<xs:element name="fsc" type="xs:string" />
<xs:element name="locid" type="xs:string" />
<xs:element name="site" msdata:ReadOnly="true" type="xs:string" minOccurs="0" />
<xs:element name="long" type="xs:decimal" minOccurs="0" />
<xs:element name="lat" type="xs:decimal" minOccurs="0" />
<xs:element name="NSFG" msdata:ReadOnly="true" type="xs:string" minOccurs="0" />
<xs:element name="proj" msdata:ReadOnly="true" type="xs:string" minOccurs="0" />
<xs:element name="PI" msdata:ReadOnly="true" type="xs:string" minOccurs="0" />
<xs:element name="PL" msdata:ReadOnly="true" type="xs:string" minOccurs="0" />
<xs:element name="PT" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
Once I have a page for each loc, I need to list all proj elements grouped by fsc in decending order.
It would look something like this:
Trinidad (loc)
--2006 (fsc)
---- this A thingy (proj - alpha order)
---- this B thingy (proj - alpha order)
--2005
---- this A thingy (proj - alpha order)
---- this B thingy (proj - alpha order)
---- this C thingy (proj - alpha order)
etc etc
All I can say is GOOD GRIEF!
XQuery owns me today.
Any XQuery experts in here?