Merge tecnique with XSL

Discussion in 'XML' started by JohnPlayerSpecial, Apr 27, 2004.

  1. Hi all,
    i need to merge this xml document:

    Doc1:
    -----
    <base>
    <content>Hello World!</content>
    </base>

    with one of these:

    Doc2:
    -----
    <root>
    <container type="container">
    </container>
    </root>

    or

    Doc3:
    -----
    <root>
    <bigcontainer type="bigcontainer">
    </bigcontainer>
    </root>

    getting this result type:

    Doc4:
    -----
    <root>
    <container type="container">
    <content>Hello World!</content>
    </container>
    </root>

    or

    Doc5:
    -----
    <root>
    <bigcontainer type="bigcontainer">
    <content>Hello World!</content>
    </bigcontainer>
    </root>

    I have structured my code to work in this mode:

    <vbscript>
    Dim s_ParsedDocument
    Dim o_DOMDoc1: Set o_DOMDoc1 =
    Server.CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")
    Dim o_DOMStyle: Set o_DOMStyle =
    Server.CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")

    Call o_DOMDoc1.Load("doc1.xml")
    Call o_DOMStyle.Load("docStyle.xsl")

    Dim o_DOMTemplate: Set o_DOMTemplate =
    Server.CreateObject("MSXML2.XSLTemplate.4.0")
    Dim o_DOMProcessor

    With o_DOMTemplate
    Set .stylesheet = o_DOMStyle
    Set o_DOMProcessor = .createProcessor()
    End With

    With o_DOMProcessor
    .input = <MSXML "Doc1" object>
    Call .addParameter("containerfile", ???? ) '<--- I could specify
    doc2.xml or doc3.xml
    Call .Transform()
    s_ParsedDocument = .output
    End With
    </vbscript>

    Now i have to do the stylesheet document and i need your help.

    Sorry for my english,
    JP
    JohnPlayerSpecial, Apr 27, 2004
    #1
    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. Kevin Flood
    Replies:
    0
    Views:
    1,000
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,699
    Kevin Flood
    Sep 13, 2004
  3. Replies:
    1
    Views:
    3,565
    A. Bolmarcich
    May 27, 2005
  4. gianguz
    Replies:
    10
    Views:
    715
    Swampmonster
    Dec 14, 2004
  5. pgodfrin
    Replies:
    6
    Views:
    113
    pgodfrin
    Mar 2, 2008
Loading...

Share This Page