homepage Welcome to WebmasterWorld Guest from 54.196.207.55
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Transform xml pasted into textarea
QuadrupleX




msg:3172811
 11:29 pm on Nov 29, 2006 (gmt 0)

I have a textarea element that I want to allow users to paste the contents of an xml file into. Once pasted into the texarea I would like to transform the xml and display the html output on a new page.

Is this easily done? And if so, can anyone give a few pointers?

Regards,
DAK

 

phranque




msg:3172936
 1:54 am on Nov 30, 2006 (gmt 0)

XSLT is where you want to look for an answer.
(Extensible Stylesheet Language Transformations)
if you google or search WebmasterWorld you will find some answers...

QuadrupleX




msg:3173295
 11:00 am on Nov 30, 2006 (gmt 0)

Yeah, I know how to transform xml with xslt.

What the problem is, is that there is no xml file as such. There is only xml markup (without an xsl stylesheet link) pasted into a textarea. I would like to transform this with an xsl stylesheet that resides on the server.

How do I transform xml markup in a textarea?

I guess I'm asking how to "get at" the data within the textarea.

daveVk




msg:3173367
 12:01 pm on Nov 30, 2006 (gmt 0)

to get text

text = document.getElementById( "myTextArea" ).value;

to parse it

var doc = new DOMParser().parseFromString( text, "text/xml" );
var documentElement = doc.documentElement;

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved