New to XSLT

Discussion in 'XML' started by seeCoolGuy, Nov 11, 2005.

  1. seeCoolGuy

    seeCoolGuy Guest

    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
    :)
    seeCoolGuy, Nov 11, 2005
    #1
    1. Advertising

  2. seeCoolGuy wrote:
    > 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.
    Tjerk Wolterink, Nov 12, 2005
    #2
    1. Advertising

  3. seeCoolGuy

    seeCoolGuy Guest

    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.

    Tjerk Wolterink wrote:
    >
    > So what do you want>??? that we give you the xslt source code to do that??
    >
    >
    > Hell no.
    seeCoolGuy, Nov 12, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    621
    Stylus Studio
    Aug 3, 2004
  2. Benjamin Hillsley
    Replies:
    3
    Views:
    1,648
    Dimitre Novatchev
    Sep 25, 2003
  3. ted
    Replies:
    1
    Views:
    607
    Laurens
    Jan 26, 2004
  4. Replies:
    2
    Views:
    701
    Henry S. Thompson
    Oct 19, 2005
  5. Replies:
    2
    Views:
    403
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page