[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Data or Template Driven?

Subject: Data or Template Driven?
From: "Scott Purcell" <spurcell@xxxxxxxxxxxxx>
Date: Wed, 3 Jul 2002 10:19:25 -0500
template driven
Hello,
I have done quite a bit of reading and I have noticed that there are two ways to transform xml. Data or Template. Where template uses the <select template>, and the data uses things like <xsl:for-each....>

I am working on my first real challenge and I am trying to produce html (using xalan when done) which will produce html. In my xml I am showing text, textareas, hiddens, etc. So my xml has <item_type>text</item_type>(textfield), and so on. I included a small snippet below.

How does one determine which direction to take when starting down this road? As usual, there may be times I have to skip a certain block if lets say the label is blank.

Thanks for any input or direction.
Scott


<?xml version='1.0'?>
<?xml:stylesheet type="text/xsl" href="newform.xsl" ?>

<ad>
    <ad_content>
        <label>Headline</label>
        <item_type>text</item_type>
        <char_count>50</char_count>
        <item_name>Headline</item_name>
        <contents><![CDATA[test]]></contents>
    </ad_content>

    <ad_content>
        <label>Body Copy</label>
        <item_type>textarea</item_type>
        <char_count>200</char_count>
        <item_name>Body Copy</item_name>
        <contents><![CDATA[Now is the time for all good men to come to the aid of their party.]]></contents>
    </ad_content>
      
    <ad_content>
        <label>Primary Image</label>
        <item_type>picture</item_type>
        <char_count />
        <item_name>Primary Image</item_name>
        <contents />
     </ad_content>

    <ad_content>
        <label>Dealership Name</label>
        <item_type>text</item_type>
        <char_count>20</char_count>
        <item_name>Dealership Name</item_name>
        <contents><![CDATA[Our Place]]></contents>
    </ad_content>
      
    <ad_content>
        <label>Date and Time of Event</label>
        <item_type>text</item_type>
        <char_count>30</char_count>
        <item_name>Date and Time of Event</item_name>
        <contents><![CDATA[July 15, 2002]]</contents>
    </ad_content>
        

    <ad_content>
        <label>Additional Info</label>
        <item_type>text</item_type>
        <char_count>30</char_count>
        <item_name>Additional Info</item_name>
        <contents><![CDATA[none]]></contents>
    </ad_content>
    
    <ad_content>
        <label>Logo</label>
        <item_type>logos</item_type>
        <char_count />
        <item_name>Logo</item_name>
        <contents />
    </ad_content>
</ad>
        

    



Scott Purcell | Developer | VERTIS | 555 Washington Ave. 4th Floor | St. Louis, MO 63101 |
T 314.588.0720 | F 314.588.0735 | spurcell@xxxxxxxxxxxxx | http://www.vertisinc.com

Vertis is a global powerhouse for integrated marketing and advertising solutions that seamlessly combine advertising, direct marketing, media, imaging and progressive technology. Vertis' products and services include: consumer and media research, media planning and placement, creative services, digital media production, targetable insert programs, fully integrated direct marketing programs, circulation-building newspaper products and eMarketing.




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.