xml element reference

S

stefano

I have a file xml(p.xml) whit XSLT stylesheet import (for xhtml
trasformation).
I want have a reference to the xml elements of p.xml from another
javascript file.If I use win.open(p.xml....) method I have a reference
to XHTML elements.
How can I do?
thanks
 
M

Martin Honnen

stefano said:
I have a file xml(p.xml) whit XSLT stylesheet import (for xhtml
trasformation).

Import? Do you have a pseudo processing instruction
<?xml-stylesheet type="text/xsl" href="stylesheet.xml"?>
to for instance have the browser do a client-side XSLT transformation
automatically when the XML document is loaded?
Or what kind of import do you use?
I want have a reference to the xml elements of p.xml from another
javascript file.If I use win.open(p.xml....) method I have a reference
to XHTML elements.

IE/Win exposes the original XML document that has been transformed as
document.XMLDocument
Firefox/Mozilla so far don't do that so there you need to use script to
load the XML file only from a URL.
 
S

stefano

yes, I have a pseudo processing instruction <?xml-stylesheet
type="text/xsl" href="stylesheet.xml"?> and I use Firefox
 
M

Martin Honnen

stefano said:
I have a pseudo processing instruction <?xml-stylesheet
type="text/xsl" href="stylesheet.xml"?> and I use Firefox

Then don't load the XML into a browser window but load it with script,
that way you get access to the DOM of the XML document and not to the
DOM of the transformation result.
Here is how you can load an XML document with script from a URL:
<http://www.faqts.com/knowledge_base/view.phtml/aid/6826/fid/616>
Of course if you also want to render the transformation result then you
need to do both, load the XML in a window and load it with script.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,244
Latest member
cryptotaxsoftware12

Latest Threads

Top