|
-
Apr 23rd, 2004, 12:39 PM
#1
Thread Starter
Hyperactive Member
RESOLVED: Insert stylesheet to existing XML
Anyone know how to insert a stylesheet instruction into an existing XML document with the DOMDocument model?
Any other model?
I need to insert something like:
<?xml-stylesheet type="text/xsl" href="Display.xsl"?>
into an existing XML document. It seems I can put this at the top of the doc and it works (when I do it using notepad).
Last edited by vbmom; Apr 23rd, 2004 at 02:03 PM.
end war
stop greed
-
Apr 23rd, 2004, 01:29 PM
#2
The document object should have a method called createProcessingInstruction.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 23rd, 2004, 01:46 PM
#3
Thread Starter
Hyperactive Member
Gee that sounds like it's on the right track, but I haven't a clue how to use it. Particularly, I want to get that stylesheet line I mentioned:
<?xml-stylesheet type="text/xsl" href="Display.xsl"?>
Would you be able to tell me how to do it?
-
Apr 23rd, 2004, 01:50 PM
#4
Thread Starter
Hyperactive Member
I see that you have to do something like:
Set jP = jXML.createProcessingInstruction("type", "text/xsl")
Call jXML.insertBefore(jP, jXML.childNodes(0))
But it's what goes in the string and data portion of the createProcessingInstruction that I can't seem to figure. It doesn't like spaces either.
-
Apr 23rd, 2004, 01:57 PM
#5
I believe it's
document.createProcessingInstruction("xml-stylesheet", 'type="text/xsl" href="Disaply.xsl"');
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 23rd, 2004, 02:03 PM
#6
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|