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

help XML


proeverij 274

Hi everybody,

I am trying to  create a simple xml. This is the way I want to display my info in html:
Proeverij 272
Prinsengracht 272, Jordaan, Amsterdam
Dutch/International
pin

I have a DTD, a XML and a XSLT but somehow it doesn't display all the info (the address info) I want.
Many thanx in advance,
hbthang

My DTD:
<!DOCTYPE guide [
     <!ELEMENT guide (restaurant)>
     <!ELEMENT restaurant (name,address,kitchen,payment)>
     <!ELEMENT name (#PCDATA)>
     <!ELEMENT address (address, area?, city)>
     <!ELEMENT area (#PCDATA)>
     <!ELEMENT city (#PCDATA)>
     <!ELEMENT kitchen (#PCDATA)>
     <!ELEMENT payment (#PCDATA)>

     <!ATTLIST address str_name CDATA #REQUIRED>
     <!ATTLIST address str_number CDATA #REQUIRED>
]>

A piece of my XML:
<guide>
 <restaurant>
      <name>Proeverij 274</name>
      <address str_name="Prinsengracht" str_number="274" area="Jordaan" city="Amsterdam" />
      <kitchen>Dutch/International</kitchen>
      <payment>visa, mastercard, pin</payment>
 </restaurant>
...
</guide>

My XSLT:
?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body style="font-family:Arial,helvetica,sans-serif;font-size:12pt">
<h2>My Restaurants Guide</h2>
<xsl:for-each select="guide/restaurant">
<xsl:value-of select="name" />
<p />
</xsl:for-each>
<xsl:for-each select="guide/restaurant/address">
<xsl:value-of select="str_name" />
<xsl:value-of select="str_number" />
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

 




Play online games with your friends with http://g.msn.com/8HMAENNL/2746??PS=

  • Follow-Ups:
    • RE: help XML
      • From: "W. Hugh Chatfield I.S.P." <hchatfield@u...>

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.