all groups > dotnet xml > march 2004 >
You're in the

dotnet xml

group:

Obtain XML data into HTML file


Obtain XML data into HTML file Matteo Migliore
3/30/2004 3:06:17 PM
dotnet xml:
Hi.

Is it possible to create an HTML file that contain XML data content and html
tags using the XML engine?

Normally use:
- XML data
- XSLT layout
- HTML page that show the page but content are into xml file

What I want is to obtain the html file that contain what IE parse.

Thanks,
Matteo Migliore.

MSN - dynamichardware@email.it

Re: Obtain XML data into HTML file Oleg Tkachenko [MVP]
3/31/2004 9:41:19 AM
[quoted text, click to view]

Provide please small sample of what you want to achieve.

--
Oleg Tkachenko [XML MVP, XmlInsider]
Re: Obtain XML data into HTML file Matteo Migliore
3/31/2004 3:07:42 PM
Hi.

Suppose this is the XML file:
----------------------------------------------------------------------------
----------------
<?xml version='1.0'?>
<lunch-menu>
<food>
<name>Cheese Pizza</name>
<price>$6.95</price>
<description>Individual deep-dish pizza with lots of mozzarella
cheese</description>
<calories>800</calories>
</food>
<food>
<name>Pepperoni Pizza</name>
<price>$7.95</price>
<description>Individual deep-dish cheese pizza with thick-cut pepperoni
slices</description>
<calories>950</calories>
</food>
.............
............
</lunch-menu>
----------------------------------------------------------------------------
----------------


Suppose this is the XSLT file:
----------------------------------------------------------------------------
----------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="calories">1500</xsl:param>
<xsl:template match="/">
<HTML>
<BODY STYLE="font-family:Arial, helvetica, sans-serif; font-size:12pt;
background-color:#EEEEEE">
<xsl:for-each select="lunch-menu/food[calories <= $calories]">
<DIV STYLE="background-color:blue; color:white; padding:4px">
<SPAN STYLE="font-weight:bold; color:white"><xsl:value-of
select="name"/></SPAN>
- <xsl:value-of select="price"/>
</DIV>
<DIV STYLE="margin-left:20px; margin-bottom:1em; font-size:10pt">
<xsl:value-of select="description"/>
<SPAN STYLE="font-style:italic">
(<xsl:value-of select="calories"/> calories per serving)
</SPAN>
</DIV>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
----------------------------------------------------------------------------
----------------

This is the HTML product:
----------------------------------------------------------------------------
----------------
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Prova - eur 5</title>
</head>

<body>

<div style="color: white; padding: 4px; background-color: teal">
<span style="font-weight: bold; color: white">Cheese Pizza</span> - eur
5.95</div>
<div style="font-size: 10pt; margin-left: 20px; margin-bottom: 1em">
Two of our famous Belgian Waffles with plenty of real maple syrup.<span
style="font-style: italic">
(650 calories per serving) </span></div>
<div style="color: white; padding: 4px; background-color: teal">
<span style="font-weight: bold; color: white">Stradsdsdswberry Belgian
Waffles</span> - $7.95</div>
<div style="font-size: 10pt; margin-left: 20px; margin-bottom: 1em">
Light Belgian waffles covered with strawberries and whipped cream.<span
style="font-style: italic">
(900 calories per serving) </span></div>
<div style="color: white; padding: 4px; background-color: teal">
<span style="font-weight: bold; color: white">Berry-Berry Belgian
Waffles</span>
- $8.95</div>
<div style="font-size: 10pt; margin-left: 20px; margin-bottom: 1em">
Light Belgian waffles covered with an assortment of fresh berries and
whipped cream.<span style="font-style: italic"> (900 calories per serving)
</span></div>
<div style="color: white; padding: 4px; background-color: teal">
<span style="font-weight: bold; color: white">French Toast</span> -
$4.50</div>
<div style="font-size: 10pt; margin-left: 20px; margin-bottom: 1em">
Thick slices made from our homemade sourdough bread.<span
style="font-style: italic">
(600 calories per serving) </span></div>
<div style="color: white; padding: 4px; background-color: teal">
<span style="font-weight: bold; color: white">Homestyle Breakfast</span> -
$6.95</div>
<div style="font-size: 10pt; margin-left: 20px; margin-bottom: 1em">
Two eggs, bacon or sausage, toast, and our ever-popular hash browns.<span
style="font-style: italic">
(950 calories per serving) </span></div>

</body>

</html>
----------------------------------------------------------------------------
----------------

Excuse me for the lenght of the post.

The last section is what i want to exit if the robot of the search engine
visit the page, for indexing.

Thanks for your help,
Matteo Migliore

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> ha scritto nel
messaggio news:%23VKOUMvFEHA.2512@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

Re: Obtain XML data into HTML file Oleg Tkachenko [MVP]
4/1/2004 11:45:39 AM
[quoted text, click to view]

Well, usually this is done using robots.txt file.
Form where you want to "exit"?

--
Oleg Tkachenko [XML MVP, XmlInsider]
Re: Obtain XML data into HTML file Matteo Migliore
4/1/2004 2:26:26 PM
Hi.

Excuse me, I don't understand the last phrase:
"Form where you want to "exit"?"

And please, can you specify me how to use robots.txt file?
Best, is it important for indexing?

Thanks very much,
Teo.

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> ha scritto nel
messaggio news:et2Zb28FEHA.576@TK2MSFTNGP11.phx.gbl...
[quoted text, click to view]

Re: Obtain XML data into HTML file Oleg Tkachenko [MVP]
4/1/2004 4:15:56 PM
[quoted text, click to view]

Well, lots of misunderstanding here. Elaborate then what did you mean
saying:

[quoted text, click to view]


[quoted text, click to view]

robots.txt file is usually used to control robots indexing your site.
Just google for it - there is lots of info.

--
Oleg Tkachenko [XML MVP, XmlInsider]
Re: Obtain XML data into HTML file Matteo Migliore
4/1/2004 4:34:30 PM
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> ha scritto nel
messaggio news:OW0$aN$FEHA.2732@tk2msftngp13.phx.gbl...
[quoted text, click to view]

The HTML content is what I want that spider "eat".
Not only XML data but hyperlink in the HTML file, meta tags etc.

[quoted text, click to view]

Robots.txt only tells spider if visit or not some pages but doesn't give
HTML content to it.

I want spider "read" what I can see doing Copy and Paste of XML page in an
editor.

Exuse me for my english ;-(

[quoted text, click to view]

AddThis Social Bookmark Button