Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Very Stupid question!!!!!

Status
Not open for further replies.

sqoti

Programmer
Dec 1, 2000
50
US
I am so new to XML and so lost it is not funny. I take sample xml code and just open it in a browser and what I get back is the code on the web page not the document contents in the XML. I was thinking when you put the following...

<?xml version=&quot;1.0&quot;?>

<oldjoke>

<burns>Say <quote>goodnight</quote>,
Gracie.</burns>

<allen><quote>Goodnight,
Gracie.</quote></allen>

<applause/>

</oldjoke>

You would get &quot;Say
Goodnight Gracie
Goodnight Gracie&quot;
in nice and neat format on the web page, but all I am getting is the code

<?xml version=&quot;1.0&quot; ?>
- <oldjoke>
- <burns>
Say
<quote>goodnight</quote>
, Gracie.
</burns>
- <allen>
<quote>Goodnight, Gracie.</quote>
</allen>
<applause />
</oldjoke>

on the web page. What am I missing. Please help me get over this hurdle of learning.

 
If you change the file extension to .htm you might see something more like what you posted. Of course that does not answer your question: What am I missing

The default action for the IE browser when opening a .xml file is to use the MSXML parser to parse the contents and verify that it is well formed. If it is, the browser contains an XSLT template as a custom resource which it uses to transform the XML into HTML which it then renders as it does every .htm page.

When you desire:
Code:
You would get &quot;Say 
                Goodnight Gracie
                Goodnight Gracie&quot;

as your display in a browser you need to figure out the HTML code to accomplish that. Then you write an XSLT page that will transform the XML input into your desired HTML output.

Does that help?
-pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top