f



XSLT TRANSFORMATION FROM XML TO plain Text

I have an XML FILE that is to be converted to Plain Text using an XSL
file.  Since I just want plain text, I do not want to set any root
element during transformation.And if I do not any root element during
transformation, it return s "java.lang.IllegalStateException: Root
element not set" exception. If I add any element for the enclosed
root, it works.
Note: I am using XMLOutputter object of JDOM API, packages
javax.xml.transform and javax.xml.transform.stream.*


Example XML file: 
<root><nextpart>test</nextpart></root>
          
 
*******************XSL FILE that returns
exception*****************************
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" indent="yes"/>
<xsl:template match="root">
<xsl:text>Hello This is the content.</xsl:text>
    <xsl:apply-templates select="nextpart"/>
</xsl:template>
...........
</xsl:stylesheet>
************************xsl file****************************


***********************XSL FILE modified*****************************
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" indent="yes"/>
<xsl:template match="root">
<document>
<xsl:text>Hello This is the content.</xsl:text>
    <xsl:apply-templates select="nextpart"/>
</xsl:template></document>
........
</xsl:stylesheet>
************************xsl file****************************
This change would generate an output:
<document>Hello This is the content.</document>
But I would just want the text without <document> tag. 

 

Any suggestions 
thanks
pradeep
0
8/12/2003 2:51:17 PM
comp.text.xml 8781 articles. 0 followers. Post Follow

3 Replies
1264 Views

Similar Articles

[PageSpeed] 38


pradeep gummi wrote:
> I have an XML FILE that is to be converted to Plain Text using an XSL
> file.  Since I just want plain text, I do not want to set any root
> element during transformation.And if I do not any root element during
> transformation, it return s "java.lang.IllegalStateException: Root
> element not set" exception. If I add any element for the enclosed
> root, it works.
> Note: I am using XMLOutputter object of JDOM API, packages
> javax.xml.transform and javax.xml.transform.stream.*

I don't know JDOM but if you want to output plain text then XMLOutputter 
sounds like the wrong tool to use

> 
> 
> Example XML file: 
> <root><nextpart>test</nextpart></root>
>           
>  
> *******************XSL FILE that returns
> exception*****************************
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:output method="text" indent="yes"/>
> <xsl:template match="root">
> <xsl:text>Hello This is the content.</xsl:text>
>     <xsl:apply-templates select="nextpart"/>
> </xsl:template>
> ..........
> </xsl:stylesheet>
> ************************xsl file****************************
> 
> 
> ***********************XSL FILE modified*****************************
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:output method="text" indent="yes"/>
> <xsl:template match="root">
> <document>
> <xsl:text>Hello This is the content.</xsl:text>
>     <xsl:apply-templates select="nextpart"/>
> </xsl:template></document>
> .......
> </xsl:stylesheet>
> ************************xsl file****************************
> This change would generate an output:
> <document>Hello This is the content.</document>
> But I would just want the text without <document> tag. 
> 
>  
> 
> Any suggestions 
> thanks
> pradeep


-- 

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

0
8/12/2003 3:00:02 PM
Hi Martin,
I need to use JDOM API for that. The outputter classes that it provides are 
DOMOutputter, SAXOutputter, XMLOutputter. Any suggestions that I can use of these.
thanks 
pradeep



Martin Honnen <Martin.Honnen@t-online.de> wrote in message news:<3F3900F2.1080807@t-online.de>...
> pradeep gummi wrote:
> > I have an XML FILE that is to be converted to Plain Text using an XSL
> > file.  Since I just want plain text, I do not want to set any root
> > element during transformation.And if I do not any root element during
> > transformation, it return s "java.lang.IllegalStateException: Root
> > element not set" exception. If I add any element for the enclosed
> > root, it works.
> > Note: I am using XMLOutputter object of JDOM API, packages
> > javax.xml.transform and javax.xml.transform.stream.*
> 
> I don't know JDOM but if you want to output plain text then XMLOutputter 
> sounds like the wrong tool to use
> 
> > 
> > 
> > Example XML file: 
> > <root><nextpart>test</nextpart></root>
> >           
> >  
> > *******************XSL FILE that returns
> > exception*****************************
> > <?xml version="1.0"?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > version="1.0">
> > <xsl:output method="text" indent="yes"/>
> > <xsl:template match="root">
> > <xsl:text>Hello This is the content.</xsl:text>
> >     <xsl:apply-templates select="nextpart"/>
> > </xsl:template>
> > ..........
> > </xsl:stylesheet>
> > ************************xsl file****************************
> > 
> > 
> > ***********************XSL FILE modified*****************************
> > <?xml version="1.0"?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > version="1.0">
> > <xsl:output method="text" indent="yes"/>
> > <xsl:template match="root">
> > <document>
> > <xsl:text>Hello This is the content.</xsl:text>
> >     <xsl:apply-templates select="nextpart"/>
> > </xsl:template></document>
> > .......
> > </xsl:stylesheet>
> > ************************xsl file****************************
> > This change would generate an output:
> > <document>Hello This is the content.</document>
> > But I would just want the text without <document> tag. 
> > 
> >  
> > 
> > Any suggestions 
> > thanks
> > pradeep
0
8/12/2003 4:39:55 PM
Hi Andy,
If you look in the XSL file that I have written you would see 
<xsl:output method="text" indent="yes"/> enclosed in that. I dont
think that is the problem. My problem is I am using XMLOutputter of
JDOM API which I believe does not output plain text document with out
any root. I would lik to know what kind of object from JDOM api should
I be using that helps to output plain text from XML transformation
without having a root element.
any suggestions... 
thanking you
pradeep 


"Andy Fish" <ajfish@blueyonder.co.uk> wrote in message news:<aq7_a.4275$ft.34269293@news-text.cableinet.net>...
> you need to use
> 
> <xsl:output method="text"/>
> 
> this will make sure only text nodes within the output XML get rendered
> 
> "pradeep gummi" <pradeep.gummi@villanova.edu> wrote in message
> news:ba9a317a.0308120651.3d195375@posting.google.com...
> > I have an XML FILE that is to be converted to Plain Text using an XSL
> > file.  Since I just want plain text, I do not want to set any root
> > element during transformation.And if I do not any root element during
> > transformation, it return s "java.lang.IllegalStateException: Root
> > element not set" exception. If I add any element for the enclosed
> > root, it works.
> > Note: I am using XMLOutputter object of JDOM API, packages
> > javax.xml.transform and javax.xml.transform.stream.*
> >
> >
> > Example XML file:
> > <root><nextpart>test</nextpart></root>
> >
> >
> > *******************XSL FILE that returns
> > exception*****************************
> > <?xml version="1.0"?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > version="1.0">
> > <xsl:output method="text" indent="yes"/>
> > <xsl:template match="root">
> > <xsl:text>Hello This is the content.</xsl:text>
> >     <xsl:apply-templates select="nextpart"/>
> > </xsl:template>
> > ..........
> > </xsl:stylesheet>
> > ************************xsl file****************************
> >
> >
> > ***********************XSL FILE modified*****************************
> > <?xml version="1.0"?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > version="1.0">
> > <xsl:output method="text" indent="yes"/>
> > <xsl:template match="root">
> > <document>
> > <xsl:text>Hello This is the content.</xsl:text>
> >     <xsl:apply-templates select="nextpart"/>
> > </xsl:template></document>
> > .......
> > </xsl:stylesheet>
> > ************************xsl file****************************
> > This change would generate an output:
> > <document>Hello This is the content.</document>
> > But I would just want the text without <document> tag.
> >
> >
> >
> > Any suggestions
> > thanks
> > pradeep
0
8/13/2003 3:59:11 AM
Reply:

Similar Artilces:

file command: "XML document text" vs "XML document text"
I've just used the file command on four files of RDF-XML with the following output: augtfidf.rdf: XML document text kyoto.rdf: XML document text stuff.rdf: XML document text tfidf.rdf: XML document text What does it mean that one of them has an extra space between "XML" and "document"? -- The kid's a hot prospect. He's got a good head for merchandising, an agent who can take you downtown and one of the best urine samples I've seen in a long time. [Dead Kennedys t-shirt] On 16.10.2012 16:06, Adam Funk wrote: > I've just used the file command on four files of RDF-XML with the > following output: > > augtfidf.rdf: XML document text > kyoto.rdf: XML document text > stuff.rdf: XML document text > tfidf.rdf: XML document text > > What does it mean that one of them has an extra space between "XML" > and "document"? Hard to tell without further information. What does file *.rdf | od -c show you? Janis Janis Papanagnou wrote: > On 16.10.2012 16:06, Adam Funk wrote: >> I've just used the file command on four files of RDF-XML with the >> following output: >> >> augtfidf.rdf: XML document text >> kyoto.rdf: XML document text >> stuff.rdf: XML document text >> tfidf.rdf: XML document text >> >> What does it mean that one ...

ANNOUNCE: Gelatin transforms plain text files to XML, JSON, or YAML
Hi Guys, I hereby announce Gelatin[1], a really simple and fast way for transforming text into a structured format. Gelatin is a combined lexer, parser, and output generator. I am pretty proud of the result, and I would be happy to hear any feedback - I am not aware of any similar projects. Gelatin has already allowed us to replace some hand-coded parsers that were a pain to maintain. The fact that we were able to adopt it so quickly let's me hope that you will like it as much as I do. There's even some documentation, please check it out. Installation instructions: ...

XSLT to transform a "flat" XML file into a structured text file
Subject: XSLT to transform a flat XML file into a structured text file I have an XML file that lists the PDF file segment names and titles of a larger document and looks something like this: <DOCUMENT> ...... ...... some lead elements ...... <SEGMENT_LIST> <SEGMENT FILE="fwd.pdf">Foreword</SEGMENT> <SEGMENT FILE="chap1.pdf">Chapter 1</SEGMENT> <SEGMENT FILE="chap2.pdf">Chapter 2</SEGMENT> <SEGMENT FILE="chap3.pdf">Chapter 3</SEGMENT> <SEGMENT FILE="v1fwd.pdf" VOLUME="Volume 1">Foreword</SEGMENT> <SEGMENT FILE="v1defs.pdf" VOLUME="Volume 1">Definitions</SEGMENT> <SEGMENT FILE="v1meth.pdf" VOLUME="Volume 1">Methodology</SEGMENT> <SEGMENT FILE="v1sachap1.pdf" VOLUME="Volume 1" GROUP='Section A">Chapter 1A</SEGMENT> <SEGMENT FILE="v1sachap2.pdf" VOLUME="Volume 1" GROUP='Section A">Chapter 2A</SEGMENT> <SEGMENT FILE="v1sachap3.pdf" VOLUME="Volume 1" GROUP='Section A">Chapter 3A</SEGMENT> <SEGMENT FILE="v1sbchap1.pdf" VOLUME="Volume 1" GROUP='Section B">Chapter 1B</SEGMENT> <SEGMENT FILE="v1sbchap2.pdf" VOLUME="Volume 1" GROUP='Section B">Chapter 2B</SEGMENT> <SEGMENT FILE=&quo...

Transform XML to XML using XSLT
hello all, seems like a simple issue, but having tried several approaches with no success I am posting this question, I have a XML in one format, I want to now convert into another XML format using XSLT. FirstType.XML: (In this XML the States sub elements appear within USA element) ------------------------------------------------ <?xml version="1.0" encoding="utf-8"?> <ROOT> <Country> <USA> <State> <City1>6000</City1> <City2>100</City2> <City3> </City3> </State> <State> <City1>1000</City1> <City2>10</City2> <City3>2</City3> </State> </USA> </Country> </ROOT> ------------------------------------------------ DestinationXML: (I want the above XML to appear this way, note the element <Type> is something I want to add - and is not in the originial XML) ------------------------------------------------ <?xml version="1.0" encoding="utf-8"?> <Region> <Area> <Type> Original </Type> <City1>6000</City1> <City2>100</City2> </Area> <Area> <Type> Original </Type> <City1>1000</City1> <City2>10</City2> </Area> &l...

Non-XML tagged value text to XML
I would like to use XSLT to translate some tagged value text to XML elements like this: Input Doc: <data>x=1.234 y=ABC z="Hello World"</data> Output Doc: <x>1.234</value> <y>ABC</y> <z>&quot;Hello World&quot;</z> Is XSLT up to the task? What would it look like? Most of the XSLT string processing code I've seen looks very verbose - can't be too efficient. mikea_59 wrote: > I would like to use XSLT to translate some tagged value text to XML > elements like this: > > Input Doc: > > <data>x=1.234 y=ABC z="Hello World"</data> > > Output Doc: > > <x>1.234</value> > <y>ABC</y> > <z>&quot;Hello World&quot;</z> > > Is XSLT up to the task? What would it look like? Most of the XSLT > string processing code I've seen looks very verbose - can't be too > efficient. Using XSLT 2.0 you can do that with regular expression matching as follows: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" encoding="UTF-8" indent="yes" /> <xsl:template match="/"> <results> <xsl:apply-templates /> </results> </xsl:template> <xsl:template match="data"...

XML to XML Transformation
I was thrust into XML about 2 weeks ago and don't know much yet. From another department in the corp I am receiving an XML file which concatenates nodes all on one line i.e. <car><make>ford</make><color>red</color><year>2001</year></car><car><make><mb> etc. etc. etc. Some lines are over 300 characters long. I need to translate this spagetti XML into something which is humanly readable. I probably need to use XSL however I'm not sure what I need to do. Any help will be much appreciated. "Will" <william.cook@kla-tencor.com> wrote in message news:8506d1f6.0310311244.49a0856c@posting.google.com... > I was thrust into XML about 2 weeks ago and don't know much yet. From > another department in the corp I am receiving an XML file which > concatenates nodes all on one line i.e. > <car><make>ford</make><color>red</color><year>2001</year></car><car><make><m b> > etc. etc. etc. Some lines are over 300 characters long. I need to > translate this spagetti XML into something which is humanly readable. View the xml file using IE or Mozilla -- they provide an appealing, aesthetic looking layout with collapse/expanding of contents of elements. > I probably need to use XSL however I'm not sure what I need to do. If you decide to use XSLT (if, because the first approach above is really what one needs...

XML to another XML format transformation using XSLT
I am new in xml, have read various documentations, but some practice examples would be more helpful than theory. I need transform one XML document to another XML document format(original standard) using XSLT transformation. Can someone specify how to make this correctly? Also, is there application that can do this? There's a lot of good tutorial information on DeveloperWorks: http://www.ibm.com/developerworks/xml/ Also, most XML parsers and XSLT processors come with some simple samples. Read through those, and come back to us if you have specific questions. -- Joe Kesselman, http://www.love-song-productions.com/people/keshlam/index.html {} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" -- /\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt." On 11/04/12 10:31, Binaryx wrote: > I am new in xml, have read various documentations, but some practice > examples would be more helpful than theory. I need transform one XML > document to another XML document format (original standard) What does "original standard" mean here? > using XSLT > transformation. Can someone specify how to make this correctly? Not unless we know what the two XML formats are. > Also, is there application that can do this? Same answer. XSLT is a language to let you write a transformation between formats. It is not a ready-made transformer. Here's an XML document from my notes app: -...

XML DOM: XML/XHTML inside a text node
In my program, I get input from the user and insert it into an XHTML document. Sometimes, this input will contain XHTML, but since I'm inserting it as a text node, xml.dom.minidom escapes the angle brackets ('<' becomes '&lt;', '>' becomes '&gt;'). I want to be able to override this behavior cleanly. I know I could pipe the input through a SAX parser and create nodes to insert into the tree, but that seems kind of messy. Is there a better way? Thanks. On Thu, 2 Nov 2005 noahlt@gmail.com wrote: > In my program, I get input from the us...

xml wrongly views as text extracted from the xml tags
we have a java framework, where we feed a request xml. this request xml is forwarded through the framework, tomcat and axis, for the backend processing, and the processing results are again received by the internet explorer, after they are transformed with an xslt by the framework. now the problem that we are facing is like - the explorer extracts the text inside all xml tags of the response xml and shows it as simple text. but, if you view the source of the 'text', it will show it all as well-formed xml. moreover, if you save the source as an xml file, and again open it through internet explorer, it will show the xml in proper way. i have tried using firefox, processing with xml spy, but with same results... has somebody experienced similar problem before??? i wonder what can be wrong in this case, and would be thankful for any pointers as to what can be the cause and solution to this. Thanks in advance, Shreyas Hi all, Finally i got what was the problem. it was because the response xml contained a <Title> </Title> tag in it. and dont know why/how, but IE was treating it as an HTML tag. i noticed that the browser window title was indeed "Mr" which is the text enclosed by the Title element. one more weird thing i noticed was that if i moved the <xsl:apply-templates> line for the tag downwords after one more template application, it was showing the xml properly alongwith the <Title> element, and not treating it as an HTML tag...

Parsing text with link from xml with XSLT
Hi, I have an xml document like this: <paragraph>hello what are you doing? searching on <link url="http:// www.google.com">google</link>?</paragraph> how can I extract data to xhtml from it so that it will be formatted as hello what are you doing? searching on <a href="http:// www.google.com">google</a>? I've tried various different methods but I can't seem to combine the text in the <paragraph> with the <link> so either I select the text: "hello what are you doing? searching on google?" or I get the link <a href="http://www.google.com">google</a> Hope someone can help, thanks in advance! Best Regards Simon, Denmark Simon Skov Boisen schrieb: > I have an xml document like this: > > <paragraph>hello what are you doing? searching on <link url="http:// > www.google.com">google</link>?</paragraph> > > how can I extract data to xhtml from it so that it will be formatted > as > > hello what are you doing? searching on <a href="http:// > www.google.com">google</a>? > > I've tried various different methods but I can't seem to combine the > text in the <paragraph> with the <link> so either I select the text: > "hello what are you doing? searching on google?" or I get the link <a > href="http://www.google.com">google</a...

XML to XML
I have a gnucash file that I'm trying to transform into an identical XML file without the invoices. I've been at this for a while now. The gnucash file is in XML and the element I'm looking into is: <gnc:transaction> I want to ignore those that contain <slot:key>gncInvoice</slot:key> which is a child of slot which is a child of slots which is a child of transactions. Any help you're willing to provide would be greatly appreciated. Thanks. Classic application for XSLT. Start with the identity transformation, then add a template which matches the ones you want to treat specially and yields no output. From your description that would be match="gnc:transaction[transactions/slots/slot/slot:key='gncInvoice']" with the namespaces declared appropriately in the stylesheet. (That looks like a somewhat unlikely markup design to me, but since I haven't played with gnucash at all I'm taking your word for it.) -- () ASCII Ribbon Campaign | Joe Kesselman /\ Stamp out HTML e-mail! | System architexture and kinetic poetry Actually, from the Relax-NG schema for gnucash, it looks like it should be more like "gnc:transaction[trn:slots/slot/slot:key='gncInvoice']" with gnc:, trn:, and slot: all bound to the appropriate namespace URIs. The fact that some of their elements -- eg <slot> -- aren't in any namespace is probably left over from a pre-namespaces initial design, as is their now-brok...

text + text
What is "text + text" supposed to do right now? It doesn't seem very useful to me. What about making "text + text" as an equivalent for "text || text"? Most strongly-typed programming languages do this. And MS SQL Server too, I think (CMIIW). -- dave ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond: > What is "text + text" supposed to do right now? Nothing. > What about making "text + text" as an equivalent for "text > || text"? Most strongly-typed programming languages do this. And MS SQL > Server too, I think (CMIIW). What would this gain except for bloat? It's not like SQL is utterly compatible with any programming language; users will still have to learn all the operators anyway. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match Peter Eisentraut wrote: >>What is "text + text" supposed to do right now? > > Nothing. Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, the current behaviour is quite strange to me. ------------------ =...

IE treats XML as plain text
My Internet Explorer stopped treating XML files as (well) XML. Any XML is opened as a simple plain text file, ignoring any headers at the beginning of the file or XSL templates assigned to it. Has anyone experienced this problem before? I think it has something to do with the file associtations in the registry, but I can't find where. Thanks in advance. JulioHM wrote: > My Internet Explorer stopped treating XML files as (well) XML. Any XML > is opened as a simple plain text file, ignoring any headers at the > beginning of the file or XSL templates assigned to it. You are more likely to find help or expertise on that in one of the IE groups on the Microsoft news server news.microsoft.com. You might want to mention there what Windows version, IE version you have and whether that problem occurs with XML loaded via HTTP from a web server or with XML loaded from the file system. If it happens for files loaded via HTTP then post a URL where that happens, someone can then check the HTTP headers the server sends to find out whether IE should treat the content served as XML or not. -- Martin Honnen http://JavaScript.FAQTs.com/ Thank you for the tip! Hi there JulioHM wrote: > My Internet Explorer stopped treating XML files as (well) XML. Any XML > is opened as a simple plain text file, ignoring any headers at the > beginning of the file or XSL templates assigned to it. > > Has anyone experienced this problem before? I think it has so...

XML or not XML?
I am developing a simple MySQL database editor, and am looking into creating an PHP/AJAX app as the GUI. A lot of this in new ground, and much more is dusting off things I haven't used in a while. My question though involves whether or nor to employ XML. I did some XML a few years back, but don't typically bother anymore. As I see it XML is great when I need to have an app with a standard data presentation that other developers can easily interface. I.E. like a bank statement that may feed a variety of applications developed by a variety of clients. However, if I am develo...

text-text
Wondering how what I input to my UTF-8 terminal gets passed along through my patched [1] trn ... Cyrillic: А Б В Г Д Е Ж З И Й К Л М Н О П а б в г д е ж з и й к л м н о п IPA: ᴀ ᴁ ᴂ ᴃ ᴄ ᴅ ᴆ ᴇ ᴈ ᴉ ᴊ ᴋ ᴌ ᴍ ᴎ ᴏ ɀ Ɂ ɂ Ƀ Ʉ Ʌ Ɇ ɇ Ɉ ɉ Ɋ ɋ Ɍ ɍ Ɏ ɏ [1] https://groups.google.com/d/msg/comp.sys.raspberry-pi/7Z37Hdrm0DM/6aqD-reXFzAJ ...

To XML or not to XML?
Ok, it has been a while since I've needed to make an involved web page. Coming back on the scene now is a bit confusing, what with all the cool stuff to use like XML, PHP, MySQL, etc... So here is my question. I'm in search of a good dynamic way to generate web pages which separates content from presentation. I am seeking to create a web site that, to put it succinctly, has a list of users and sets of information corresponding to each user. I am familiar with how to do this using PHP, MySQL, and regular old HTML. I maintain the user database in MySQL and dynamically present it and the information with PHP. This is very easy to do in terms of coding for it. But I'm wondering? Is it time for me to switch to the XML with XSL method instead? Everyone seems to be talking of XML as the end all be all. I've looked into it, and on the surface, I just can't tell if it's worth it. I don't really see the benefit. XML is just a "create your own HTML tags" and then figure out wtf to do with them orgy. Great, so I can write <dog>Spot</dog>. Whoop de do, that's useless to me unless I write a parser for it to display it in a user friendly way. And I shouldn't have to write a parser, there should be standardized ones for certain purposes. But wait, isn't that what HTML already is? A bunch of <dog>Spot</dog> (figuratively speaking) with the parsers having been written and mostly standardized between companies ages ago...

How to use XSLT to transform XML according to the data in another XML
I have a XML containing more information than required. And I want to transform it to a XML with less information according to the requirement data in another XML. How could I accomplish this using XSLT? Here're the XML files: source.xml : <AllFields> <field name="f1", type="N">value1</field> <field name="f2", type="N">value1</field> <field name="f3", type="N">value1</field> <field name="f4", type="N">value1</field> .... </AllFields> requirement.xml : <requiredFields> <field>f1</field> <field>f3</field> </requiredFields> result.xml : <AllFields> <field name="f1", type="N">value1</field> <field name="f3", type="N">value1</field> </AllFields> Thanks in advance! ...

Example to transform xml to text file
Folks I am new to XSL and XSLT. I have xml file. I want to transform it in a text file. IS there any way or example that i can learn and see. thanks CSUIDL PROGRAMMEr wrote: > I am new to XSL and XSLT. I have xml file. I want to transform it in a > text file. First you need to decide what information you want to copy out of the XML file, in what order. Then write an XSLT stylesheet which yields that data, using the <xsl:output method="text"/> directive to say you want to produce bare text rather than XML or HTML markup. Check the web for XSLT tutorials; some of 'em must illustrate this... -- Joe Kesselman / Beware the fury of a patient man. -- John Dryden This previous discussion between Joe and myself may be useful to you; if not precisely the blank lines problem... "unwanted blank lines in output when using xalan" Feb 7 http://groups.google.com/group/comp.text.xml/browse_frm/thread/97c2567e82937609/635d57d40d7ad3e3?lnk=st&q=&rnum=11#635d57d40d7ad3e3 --Jeff ok here is a sample of my xml file msg> <date>2006-02-19</date> <time>10:52:05</time> <sender>syed</sender> <receiver>#IRC</receiver> <data>kjkk</data> </msg> I want output to be in this form in text file (Date:time) sender data receiver example (2006-02-19:10:52:05) syed kjkk #IRC thank XSLT is a programming language. There are multiple ways the simple tr...

How to use XSLT to transform XML according to the data in another XML #2
I have a XML containing more information than required. And I want to transform it to a XML with less information according to the requirement data in another XML. How could I accomplish this using XSLT? Here're the XML files: source.xml : <AllFields> <field name="f1", type="N">value1</field> <field name="f2", type="N">value2</field> <field name="f3", type="N">value3</field> <field name="f4", type="N">value4</field> .... </AllFields> requirement.xml : <requiredFields> <field>f1</field> <field>f3</field> </requiredFields> result.xml : <AllFields> <field name="f1", type="N">value1</field> <field name="f3", type="N">value3</field> </AllFields> Thanks in advance! Tempore 17:58:33, die Wednesday 02 February 2005 AD, hinc in foro {comp.text.xml} scripsit <ai2003lian@yahoo.com>: > I have a XML containing more information than required. And I want to > transform it to a XML with less information according to the > requirement data in another XML. How could I accomplish this using > XSLT? Hi, Here's one approach: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="AllFields"> <xsl:copy> <xsl:copy-...

accept xml instead of plain Python text?
I am wondering whether that has been any discussion of a project like the following in the Python world: - jezix http://www.tel.fer.hr/users/mtopol/jezix/ - javaml http://sourceforge.net/projects/javaml/ The general idea is that it would sometimes be nice to be able to feed xml to the Python parser instead of plain text. I can think of several reasons why this would be _inconvenient_ for the Python community. Foremost among them would be that no plain-text tool would work with xml'zed Python. Has the subject been discussed in the Python community? If so, where? I suspect this is a ba...

Plain text file to xml file convert
Hi All, I'm new to xml. and In one of my application i want to convert the text file into xml file for further processing. So, if anyone Know how to do it plz tell me any solution. On Feb 17, 3:25 pm, "mahesh" <mahesh2...@gmail.com> wrote: ... > I'm new to xml. This is 'Java', in case you are confused. >..and In one of my application i want to convert the > text file into xml file for further processing. Oh.. using Java? > So, if anyone Know how to do it plz tell me any solution. Beyond putting the entire text into a CDATA section, I do not s...

Converting xls or plain text file to xml
Hi, I am wondering if there is way to convert a xls (with column headers) or a plain text file to an xml file without knowing anything about xsd. I know in Excel you can actually convert the file to xml, given that you provide the xsd. However, I have a client who doesn't know much about xml, and I would like if there is anything she can do. Actually, Excel is just one way she puts her data in, she can in fact put the data into any editor provided that it is simple. Do you have any suggestion in that case that she can still output something in xml? Please advice. Thanks in advance. Your help would be greatly appreciated. sweetpotatop@yahoo.com wrote: > I am wondering if there is way to convert a xls (with column headers) > or a plain text file to an xml file without knowing anything about > xsd. Sure. Schema validation is optional. For basic data processing, you can often ignore schemas and just work with well-formed documents. If you know how to read the source data, and you know how you want to map that to XML, this is just a Simple Matter Of Programming. Excel is using the schema because it's trying to be general purpose and let the schema help guide that mapping. But hand-coding certainly works. "Joseph J. Kesselman" <keshlam-nospam@comcast.net> wrote in message news:486ce4d8$1@kcnews01... > sweetpotatop@yahoo.com wrote: >> I am wondering if there is way to convert a xls (with column headers) >> or a plain text...

How to retrieve XML CDATA text contents by org.xml.sax.ext.DefaultHandler2?
For example I have a XML tag <script> <![CDATA[ My script is here ]]> </script> I am using org.xml.sax.ext.DefaultHandler2 to parse my XML file. How do I retrieve my script contents? What shall I do in these two methods? @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equals("script")) { // How to retrieve my script contents? } } @Override public void endElement(String uri, String localName, String qName) throws SAXException { if (qName.equals("script")) { ...

Xml to Xml transform problem
Hi,all I was confused with xml transform. I had a xml file like: <Details> <names> <name/> <name/> ......or more <name/> </names> <orders> <order/> <order/> .....or more <order/> </orders/> ....or more element </Details> and the destination would be like: <Details> <Detail> <name/> <order/> .....or more element </Detail> <Detail> <name/> <order/> .....or more element </Detail> .....or more details <Details> the num of details may be as large as 2000, first get the nums and simply selected use the [index], as: <xsl:template match=3D"/"> <Details> <detail> <name> <xsl:value-of select=3D"/Details/names/name[1]"/> </name> <order> <xsl:value-of select=3D"/Details/orders/order[1]"/> </order> ....more elements </detail> ....more detail with the index </Details> </xsl:template > when the num is lagrer than a num ,maybe 30,the JAXP would throw the javax.xml.transform.TransformerConfigurationException: ...

Web resources about - XSLT TRANSFORMATION FROM XML TO plain Text - comp.text.xml

Transformation - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Mardi Gras 2016 Sydney: ‘My transformation into a drag queen’
I HAVE a new-found respect for women and the transgender community, but more than anything I have superior praise for drag queens.

NTT Communications Enhances Enterprise Cloud to Accelerate Digital Transformation
NTT Communications Corporation (NTT Com), the ICT solutions and international communications business within the NTT Group (NYSE:NTT), announced ...

"Writing my wrongs": Convicted killer on life transformation
Shaka Senghor made a deadly mistake 30 years ago, but he says his life today is proof that "humans are redeemable"

Digital transformation designed for the customer
Part business process redesign, part agile development, the new re-engineering is endless — just like customer demands. Here's how smart companies ...

Fossil Fuels Lose Out In Japan’s Power Sector Transformation
Fossil fuels are set to lose out as Japan continues its on-going power sector transformation, according to the Institute for Energy Economics ...

Digital transformation designed for the customer
In his three years at Valdosta State University , CIO Brian Haugabrook has made a habit of walking around the Georgia campus and stopping now ...

Agile Transformation
I wanted to let you know that I've posted a two-part series on Construx's experience with Agile Transformations, pitfalls, keys to success, and ...

Sears Loses $580 Million In Last Quarter Of 2015, Still Working On That ‘Transformation’ Thing
Earlier this week, we received an e-mail from a reader with a tip for our Sears and Kmart store closings list. We checked it out and learned ...

‘SNL’ Mocks Hillary’s Transformation Into Bernie
'There's a lot of work to be done, and that is why I am sick and tired of hearing about my own damn emails'

Resources last updated: 3/14/2016 1:41:23 AM