Insert data from XML doc into XHTML template

Discussion in 'XML' started by knowbetter, Jun 26, 2004.

  1. knowbetter

    knowbetter Guest

    Hi all,

    I've got two XML docs in memory as strings. One doc contains data, the
    other contains an XHTML-based template with custom tags for my
    application. What would be the best way to get the data into the
    template? Right now the custom tags are in the form <xxx:field
    name="fieldname"> ...#ItemData#... </xxx:field>. Where xxx is a custom
    namespace prefix "field" is the actual tag name, and "fieldname"
    corresponds to the tag in my data XML doc. #ItemData# is a placeholder
    representing where the user wants me to insert the actual data from
    the field.

    My goal here is similar to many Content Management templates. However,
    I want to have the option of easily adding new custom tags in the
    future should the need arise. I thought about using XSLT, but I'm not
    sure how to properly combine these two docs into a 3rd (and,
    critically, these are both in-memory strings, not files, so I assume
    document() might not work). Can someone point me in the right
    direction. Or is there a better way to go about this?

    TIA,
    Kelly
    knowbetter, Jun 26, 2004
    #1
    1. Advertising

  2. knowbetter

    GIMME Guest

    Post a simple example of what you have and what you want ...

    Right now the custom tags are in the form <xxx:field name="fieldname">
    ....#ItemData#... </xxx:field>.
    GIMME, Jun 28, 2004
    #2
    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. John Wallace
    Replies:
    0
    Views:
    456
    John Wallace
    Jul 22, 2003
  2. Matt
    Replies:
    3
    Views:
    479
    Tor Iver Wilhelmsen
    Sep 17, 2004
  3. Pavlik Morosov
    Replies:
    11
    Views:
    6,579
    dorayme
    Aug 11, 2005
  4. Harry Zoroc
    Replies:
    1
    Views:
    915
    Gregory Vaughan
    Jul 12, 2004
  5. jkflens
    Replies:
    2
    Views:
    1,446
    jkflens
    May 30, 2006
Loading...

Share This Page