HandsOn Linking the Attribute Centric XML File with the Generic Stylesheet and Displaying the Transformed File in a Web Browser

1. Save the Products_AttribCentric.xml file as Products_AttribCentric_ 2.xml.

2. Open the Products_AttribCentric_2.xml file with Notepad.

3. Type the following definition in the first line of this file: <?xml-stylesheet type="text/xsl" href="AttribToHTML.xsl"?>

The above instruction establishes a reference to the XSL file.

4. Save the changes made to the Products_AttribCentric_2.xml file and close Notepad.

5. Open the Products_AttribCentric_2.xml file in your browser. You should see the data formatted in a table (see Figure 29-25).

Using StyteshQCt to convcrt attribute based XML to HTML

Microsoft Internet Explore

EBB

I File Edit View Favorites Toefc Heb

»

o»« - o tí \É a

J ' 5eareh Favorites

□ i ft. # -i

1 Address |^}C!\LBarn_XNL\Product£_AttnbCentric_2.>ím1

V Q Go linVs y>

ProducHD

PrviiudNHK

Üuppliei-ID CateqoiylD OujntitvPciiliiit

nitt-n r i ll . ¡ . 1

UnitfOnGrdcr

ieoiiteiLevef Discontinued

1

Chai

1

1

10 boxes x 20 bags

IS

3Í>

0

10

False

2

Chang

1

I ¡24 - 12 02 [bottles

17

40

25

False

3

Aniseed Syrup

1

2

12 -550 ml battles

10

13

70

25

False

4

Chef Anton's Cajun Seasoning

2

2

48- 602 jais

22

53

0

0

False

5

Chef Anton's Gumbo Mix

2

2

36 boxes

21.35

0

0

0

True

Eoysenbecty

Spread

3

2

12- So2 jais

25

120

0

25

False

Dorc J My Corrputct

Figure 29-25: You can apply a generic stylesheet to an XML document generated by the ADO to display the data in a simple HTML table.

Dorc J My Corrputct

Figure 29-25: You can apply a generic stylesheet to an XML document generated by the ADO to display the data in a simple HTML table.

0 0

Post a comment