New to XSLT

S

seeCoolGuy

I'm new to the whole XML / XSL tech, I've used XML w/ ado recordsets
before and have had no issues but never needed to transfer files
between systems. Now w/ Sql Server I need to import a large XML doc
but I'm having difficulty with the tags, here is a snapshot of what I'm
working with:

I want to take this:
<root>
<Schema name="Schema3" xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="tblnewproducts" content="eltOnly" model="closed"
order="many">
<element type="TAG"/>
<element type="Parent"/>
<element type="Products_x0021_1_x0021_id_x0021_Element"/>
<element type="Products_x0021_1_x0021_cat_x0021_Element"/>
<element type="Products_x0021_1_x0021_name_x0021_Element"/>
<element
type="Products_x0021_1_x0021_description_x0021_Element"/>
<element type="Products_x0021_1_x0021_the_basics_x0021_Element"/>
<element type="Products_x0021_1_x0021_pricing_x0021_Element"/>
<element
type="Products_x0021_1_x0021_configuration_x0021_Element"/>
<element type="Products_x0021_1_x0021_highlights_x0021_Element"/>
<element
type="Products_x0021_1_x0021_datasheettext_x0021_Element"/>
<element
type="Products_x0021_1_x0021_linedrawingtext_x0021_Element"/>
<element type="Products_x0021_1_x0021_presstext_x0021_Element"/>
</ElementType>
<ElementType name="TAG" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="Parent" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="Products_x0021_1_x0021_id_x0021_Element"
content="textOnly" model="closed" dt:type="i4"/>
<ElementType name="Products_x0021_1_x0021_cat_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_name_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType
name="Products_x0021_1_x0021_description_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_the_basics_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_pricing_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType
name="Products_x0021_1_x0021_configuration_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_highlights_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType
name="Products_x0021_1_x0021_datasheettext_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType
name="Products_x0021_1_x0021_linedrawingtext_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_presstext_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
</Schema>
<tblnewproducts xmlns="x-schema:#Schema3">
<TAG>1</TAG>
<Products_x0021_1_x0021_id_x0021_Element>5</Products_x0021_1_x0021_id_x0021_Element>

<Products_x0021_1_x0021_cat_x0021_Element>Text1</Products_x0021_1_x0021_cat_x0021_Element>

<Products_x0021_1_x0021_name_x0021_Element>Text2</Products_x0021_1_x0021_name_x0021_Element>

<Products_x0021_1_x0021_description_x0021_Element>Text3</Products_x0021_1_x0021_description_x0021_Element>

<Products_x0021_1_x0021_the_basics_x0021_Element>Text4</Products_x0021_1_x0021_the_basics_x0021_Element>

<Products_x0021_1_x0021_pricing_x0021_Element>Text5</Products_x0021_1_x0021_pricing_x0021_Element>

<Products_x0021_1_x0021_configuration_x0021_Element>Text6</Products_x0021_1_x0021_configuration_x0021_Element>

<Products_x0021_1_x0021_highlights_x0021_Element>Test7</Products_x0021_1_x0021_highlights_x0021_Element>

<Products_x0021_1_x0021_datasheettext_x0021_Element>Test8</Products_x0021_1_x0021_datasheettext_x0021_Element>

<Products_x0021_1_x0021_linedrawingtext_x0021_Element>Test9</Products_x0021_1_x0021_linedrawingtext_x0021_Element>

<Products_x0021_1_x0021_presstext_x0021_Element>Test10</Products_x0021_1_x0021_presstext_x0021_Element>
</tblnewproducts>
</root>

I want to conver the above to the following XML fragment:

<root>
<Schema name="Schema3" xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="tblnewproducts" content="eltOnly" model="closed"
order="many">
<element type="TAG"/>
<element type="Parent"/>
<element type="id"/>
<element type="cat"/>
<element type="name"/>
<element type="description"/>
<element type="the_basics"/>
<element type="pricing"/>
<element type="configuration"/>
<element type="highlights"/>
<element type="datasheettext"/>
<element type="linedrawingtext"/>
<element type="presstext"/>
</ElementType>
<ElementType name="TAG" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="Parent" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="id" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="cat" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="name" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="description" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="the_basics" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="pricing" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="configuration" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="highlights" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="datasheettext" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="linedrawingtext" content="textOnly"
model="closed" dt:type="string"/>
<ElementType name="presstext" content="textOnly" model="closed"
dt:type="string"/>
</Schema>
<tblnewproducts>
<TAG>1</TAG>
<id>TEXT1</id>
<cat>TEXT2</cat>
<name>TEXT3</name>
<description>TEXT4</description>
<the_basics>TEXT5</the_basics>
<pricing>TEXT6</pricing>
<configuration>TEXT7</configuration>
<highlights>TEXT8</highlights>
<datasheettext>TEXT9</datasheettext>
<linedrawingtext>TEXT10</linedrawingtext>
<presstext>TEXT11</presstext>
</tblnewproducts>
</root>
I do not have a good concept of XSLT or a wizard to help me convert it
:)
 
T

Tjerk Wolterink

seeCoolGuy said:
I do not have a good concept of XSLT or a wizard to help me convert it
:)


So what do you want>??? that we give you the xslt source code to do that??


Hell no.
 
S

seeCoolGuy

Actually information on how to begin my quest for the xslt, I've done
several google searches, but because I'm still unfamiliar w/ xslt I
thought perhaps someone has a good starting site that they'd
recommend... especially since i'm trying to conver the tag names maybe
even a site that would provide a good reference. the other route i'm
taking is to open the file via vbscript and rip out the tagnames that I
do not want and replace them w/ the ones I do. That appears to work at
the moment. I wanted to use XSL because I thought it would help me w/
future projects as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top