homepage Welcome to WebmasterWorld Guest from 54.237.235.12
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Transform xml pasted into textarea
QuadrupleX

5+ Year Member



 
Msg#: 3172809 posted 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

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 3172809 posted 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

5+ Year Member



 
Msg#: 3172809 posted 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

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3172809 posted 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