Click here to Skip to main content
15,914,488 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralACCESS A DATABASE USING MFC DIALOGUE BOXES Pin
Wisdom20043-May-04 21:03
Wisdom20043-May-04 21:03 
QuestionHow to use msxml4.dll in project? Pin
Anonymous3-May-04 7:12
Anonymous3-May-04 7:12 
AnswerRe: How to use msxml4.dll in project? Pin
Andrew Quinn AUS25-May-04 5:46
Andrew Quinn AUS25-May-04 5:46 
GeneralXSL Table view Pin
mauricexy3-May-04 4:21
mauricexy3-May-04 4:21 
GeneralRe: XSL Table view Pin
mauricexy4-May-04 3:52
mauricexy4-May-04 3:52 
Generalproblem with xslt! Pin
hassan azizi30-Apr-04 3:37
hassan azizi30-Apr-04 3:37 
Generalproblem with xslt! Pin
hassan azizi30-Apr-04 3:26
hassan azizi30-Apr-04 3:26 
GeneralNewbie XML/XSL question Pin
Anonymous29-Apr-04 16:15
Anonymous29-Apr-04 16:15 
I am doing a simple task where I am trying to create a table of cars with co
lumn headers such as model, make, color etc and then have details of the dif
ferent cars underneath ..... and I have to create a dtd, xml and xls file fo
r them. I have tried entering one set of data for a Mercedes car but the dat
a just all comes out together on one line and doesn't create the table as I
had hoped! My output looks like this:

Cars for Sale
makemodelyearcolorengineradioair conditioningpower windowspower steeringpowe
r brakes1Mercedes BenzE2402003Black8fuel_injected yes yes yes yes yes

Any help MUCH appreciated. Thanks

Here is my code:

cars_for_sale.DTD:

<?xml version="1.0"?>

<!ELEMENT cars (car+)>
<!ELEMENT car (make, model, year, color, engine, number_of_doors, transmissi
on_type, accessories*)>
<!ELEMENT engine (number_of_cylinders+, fuel_system)>
<!ELEMENT make (#PCDATA)>
<!ELEMENT model (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT color (#PCDATA)>
<!ELEMENT number_of_doors (#PCDATA)>
<!ELEMENT transmission_type (#PCDATA)>
<!ELEMENT accessories (#PCDATA)>
<!ELEMENT number_of_cylinders (#PCDATA)>
<!ELEMENT fuel_system (#PCDATA)>

<!ATTLIST accessories radio CDATA #REQUIRED>
<!ATTLIST accessories air_conditioning CDATA #REQUIRED>
<!ATTLIST accessories power_windows CDATA #REQUIRED>
<!ATTLIST accessories power_steering CDATA #REQUIRED>
<!ATTLIST accessories power_brakes CDATA #REQUIRED>

<!ENTITY bmw "B M W">
<!ENTITY me "Mercedes Benz">
<!ENTITY fo "Ford">
<!ENTITY v "Volvo">
<!ENTITY mi "Mini">
<!ENTITY j "Jaguar">
<!ENTITY p "Peugeot">
<!ENTITY rr "Rolls Royce">


cars_for_sale.XML:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE cars_for_sale SYSTEM "cars_for_sale.dtd">

<?xml-stylesheet type="text/xsl" href="cars_for_sale.xsl"?>

<cars_for_sale>
<car id = "1">
<make>&me;</make>
<model>E240</model>
<year>2003</year>
<color>Black</color>
<engine>
<number_of_cylinders>8</number_of_cylinders>
<fuel_system>fuel_injected</fuel_system>
</engine>
<number_of_doors>5</number_of_doors>
<transmission_type>Diesel</transmission_type>
<accessories>
<radio>yes</radio>
<air_conditioning>yes</air_conditioning>
<power_windows>yes</power_windows>
<power_steering>yes</power_steering>
<power_brakes>yes</power_brakes>
</accessories>
</car>
</cars_for_sale>



cars_for_sale.XSL:

<?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 = "/">

<h1>Cars for Sale</h1>
<car border = "border">
<tr>
<th></th>
<th>make</th>
<th>model</th>
<th>year</th>
<th>color</th>
<th>engine</th>
<th>radio</th>
<th>air conditioning</th>
<th>power windows</th>
<th>power steering</th>
<th>power brakes</th>
</tr>

<xsl:for-each select = "cars_for_sale/car">

<tr>
<th><xsl:value-of select = "@id" /></th>
<td><xsl:value-of select = "make" /></td>
<td><xsl:value-of select = "model" /></td>
<td><xsl:value-of select = "year"/></td>
<td><xsl:value-of select = "color"/></td>
<td><xsl:value-of select = "engine/number_of_cylinders"/></td>
<td><xsl:value-of select = "engine/fuel_system"/></td>
<td><xsl:value-of select = "accessories"/></td>
</tr>

</xsl:for-each>

</car>
</xsl:template>
</xsl:stylesheet>

GeneralRe: Newbie XML/XSL question Pin
Member 64272914-May-04 2:46
Member 64272914-May-04 2:46 
GeneralStoring XSLT files in SQL Server Pin
Member 116304929-Apr-04 12:29
Member 116304929-Apr-04 12:29 
GeneralParsing XML with VBScript Pin
lnong29-Apr-04 12:04
lnong29-Apr-04 12:04 
Generalsend xml Pin
hmdhmd27-Apr-04 0:58
hmdhmd27-Apr-04 0:58 
GeneralRe: send xml Pin
Ryan Roberts27-Apr-04 3:03
Ryan Roberts27-Apr-04 3:03 
GeneralRe: send xml Pin
Anonymous28-Apr-04 23:55
Anonymous28-Apr-04 23:55 
GeneralIXMLDOM Pin
Stojan7823-Apr-04 1:21
Stojan7823-Apr-04 1:21 
Generalxml digital signature Pin
nuez21-Apr-04 4:56
nuez21-Apr-04 4:56 
GeneralRe: xml digital signature Pin
ian mariano25-Apr-04 14:40
ian mariano25-Apr-04 14:40 
QuestionAvailable DTD for MS Project? Pin
anderslundsgard19-Apr-04 20:30
anderslundsgard19-Apr-04 20:30 
QuestionHow to include different XSLT files on the fly based on some criteria? Pin
Mohit19-Apr-04 12:09
Mohit19-Apr-04 12:09 
QuestionCan Fill Pin
wokankan19-Apr-04 1:17
wokankan19-Apr-04 1:17 
GeneralAn xml browser-based electronic medical record Pin
ejam17-Apr-04 19:21
ejam17-Apr-04 19:21 
GeneralRe: An xml browser-based electronic medical record Pin
Member 52486620-Apr-04 5:45
Member 52486620-Apr-04 5:45 
GeneralInner XML Pin
jithen_dt16-Apr-04 3:15
jithen_dt16-Apr-04 3:15 
GeneralRe: Inner XML Pin
Mike Ellison18-Apr-04 19:54
Mike Ellison18-Apr-04 19:54 
GeneralXML/XSLT/XML Schema questions Pin
rt280016-Apr-04 2:57
professionalrt280016-Apr-04 2:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.