Connecting Tech Pros Worldwide Help | Site Map

xml element reference

stefano
Guest
 
Posts: n/a
#1: Dec 5 '05
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

Martin Honnen
Guest
 
Posts: n/a
#2: Dec 5 '05

re: xml element reference




stefano wrote:
[color=blue]
> I have a file xml(p.xml) whit XSLT stylesheet import (for xhtml
> trasformation).[/color]

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?
[color=blue]
> 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.[/color]

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.


--

Martin Honnen
http://JavaScript.FAQTs.com/
stefano
Guest
 
Posts: n/a
#3: Dec 5 '05

re: xml element reference


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

Martin Honnen
Guest
 
Posts: n/a
#4: Dec 5 '05

re: xml element reference




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

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.


--

Martin Honnen
http://JavaScript.FAQTs.com/
Closed Thread