f



XML to text output

Hi

I'm fumbling through xml and I'm having a problem which I'm sure is easy 
to correct.  Here's the xml:

<area1>
  <name>John</name>
  <age>22</age>
</area1>
<area2>
  <city>London</city>
  <state>OH</state>
</area2>

I want to pull out name/age/city/state.  Seems simple, but because I 
have another element (is that the correct term?) area2, things get all 
munged up.  Like I said, this is very simple.  Here's my xsl:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text"/>

<xsl:template match="area1">
  <xsl:value-of select="name"/>
  <xsl:value-of select="age"/>
</xsl:template>

<xsl:template match="area2">
  <xsl:value-of select="city"/>
  <xsl:value-of select="state"/>
</xsl:template>

When I try and apply this I get an error:

% xsltproc test.xml test.xsl
test.xml:6: parser error : Extra content at the end of the document
<area2>
^
cannot parse test.xml

What am I doing wrong?

Thanks!

0
no69 (380)
5/17/2004 3:44:16 PM
comp.text.xml 8781 articles. 0 followers. Post Follow

8 Replies
983 Views

Similar Articles

[PageSpeed] 33


Jim wrote:


> I'm fumbling through xml and I'm having a problem which I'm sure is easy 
> to correct.  Here's the xml:
> 
> <area1>
>  <name>John</name>
>  <age>22</age>
> </area1>
> <area2>
>  <city>London</city>
>  <state>OH</state>
> </area2>

the above is not well-formed as it doesn't have a single root element 
that contains all other elements.


> When I try and apply this I get an error:
> 
> % xsltproc test.xml test.xsl
> test.xml:6: parser error : Extra content at the end of the document
> <area2>
> ^
> cannot parse test.xml
> 
> What am I doing wrong?

You need to correct your XML to have a root element.

-- 

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

0
mahotrash (2052)
5/17/2004 3:47:14 PM
Martin Honnen wrote:
> 
> 
> Jim wrote:
> 
> 
>> I'm fumbling through xml and I'm having a problem which I'm sure is 
>> easy to correct.  Here's the xml:
>>
>> <area1>
>>  <name>John</name>
>>  <age>22</age>
>> </area1>
>> <area2>
>>  <city>London</city>
>>  <state>OH</state>
>> </area2>
> 
> 
> the above is not well-formed as it doesn't have a single root element 
> that contains all other elements.
> 
> 
>> When I try and apply this I get an error:
>>
>> % xsltproc test.xml test.xsl
>> test.xml:6: parser error : Extra content at the end of the document
>> <area2>
>> ^
>> cannot parse test.xml
>>
>> What am I doing wrong?
> 
> 
> You need to correct your XML to have a root element.
> 

So you can't have multiple root elements in the same XML?  Crap--I can't 
change the XML--it's what I've been given to work with.

0
no69 (380)
5/17/2004 4:10:25 PM
On Mon, 17 May 2004 11:44:16 -0400, Jim <no@no.no> wrote:

>Hi
>
>I'm fumbling through xml and I'm having a problem which I'm sure is easy 
>to correct.  Here's the xml:
>
><area1>
>  <name>John</name>
>  <age>22</age>
></area1>
><area2>
>  <city>London</city>
>  <state>OH</state>
></area2>

Your XML File must have only one root :
<areas>
 <area1>
   <name>John</name>
   <age>22</age>
 </area1>
 <area2>
   <city>London</city>
   <state>OH</state>
 </area2>
</areas>

>
>I want to pull out name/age/city/state.  Seems simple, but because I 
>have another element (is that the correct term?) area2, things get all 
>munged up.  Like I said, this is very simple.  Here's my xsl:
>
><?xml version="1.0"?>
><xsl:stylesheet version="1.0" 
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
><xsl:output method="text"/>
>
><xsl:template match="area1">
>  <xsl:value-of select="name"/>
>  <xsl:value-of select="age"/>
></xsl:template>
>
><xsl:template match="area2">
>  <xsl:value-of select="city"/>
>  <xsl:value-of select="state"/>
></xsl:template>
>
>When I try and apply this I get an error:
>
>% xsltproc test.xml test.xsl
>test.xml:6: parser error : Extra content at the end of the document
><area2>
>^
>cannot parse test.xml
>
>What am I doing wrong?
>
>Thanks!

--
Philippe

0
5/17/2004 4:11:43 PM

Jim wrote:


>> You need to correct your XML to have a root element.
>>
> 
> So you can't have multiple root elements in the same XML?  Crap--I can't 
> change the XML--it's what I've been given to work with.

Check the XML specification
   http://www.w3.org/TR/REC-xml/#sec-documents
it says
   A data object is an XML document if it is well-formed, as defined in
   this specification.
and the production rule for document is
   document	   ::=   	prolog element Misc*
so in an XML document there is exactly one root element.

What you have been given is formally no XML.
-- 

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

0
mahotrash (2052)
5/17/2004 4:19:08 PM
Martin Honnen wrote:

> 
> 
> Jim wrote:
> 
> 
>> I'm fumbling through xml and I'm having a problem which I'm sure is 
>> easy to correct.  Here's the xml:
>>
>> <area1>
>>  <name>John</name>
>>  <age>22</age>
>> </area1>
>> <area2>
>>  <city>London</city>
>>  <state>OH</state>
>> </area2>
> 
> 
> the above is not well-formed as it doesn't have a single root element 
> that contains all other elements.
> 
> 
>> When I try and apply this I get an error:
>>
>> % xsltproc test.xml test.xsl
>> test.xml:6: parser error : Extra content at the end of the document
>> <area2>
>> ^
>> cannot parse test.xml
>>
>> What am I doing wrong?
> 
> 
> You need to correct your XML to have a root element.
> 

Ok, what if I wrapped the whole thing:

<file>
  <area1>
   <name>John</name>
   <age>22</age>
  </area1>
  <area2>
   <city>London</city>
   <state>OH</state>
  </area2>
</file>


0
no69 (380)
5/17/2004 4:23:07 PM
Jim wrote:

> Martin Honnen wrote:
> 
>>
>>
>> Jim wrote:
>>
>>
>>> I'm fumbling through xml and I'm having a problem which I'm sure is 
>>> easy to correct.  Here's the xml:
>>>
>>> <area1>
>>>  <name>John</name>
>>>  <age>22</age>
>>> </area1>
>>> <area2>
>>>  <city>London</city>
>>>  <state>OH</state>
>>> </area2>
>>
>>
>>
>> the above is not well-formed as it doesn't have a single root element 
>> that contains all other elements.
>>
>>
>>> When I try and apply this I get an error:
>>>
>>> % xsltproc test.xml test.xsl
>>> test.xml:6: parser error : Extra content at the end of the document
>>> <area2>
>>> ^
>>> cannot parse test.xml
>>>
>>> What am I doing wrong?
>>
>>
>>
>> You need to correct your XML to have a root element.
>>
> 
> Ok, what if I wrapped the whole thing:
> 
> <file>
>  <area1>
>   <name>John</name>
>   <age>22</age>
>  </area1>
>  <area2>
>   <city>London</city>
>   <state>OH</state>
>  </area2>
> </file>
> 
> 

I figured it out.  I can wrap the whole code in tags and then apply my 
sheet.

How can I ignore elements?  Say I have the xml:

<file>
  <area1>
   <name>John</name>
   <age>22</age>
  </area1>
  <area2>
   <city>London</city>
   <state>OH</state>
  </area2>
</file>

and I only want to output some of the elements.  Maybe all of area1, but 
none of area2.  Or all of area1, but just area2/city.

Thanks for all the assistance.

0
no69 (380)
5/17/2004 6:01:54 PM
Hello, Jim!
You wrote  on Mon, 17 May 2004 14:01:54 -0400:


[Sorry, skipped]

 J> How can I ignore elements?  Say I have the xml:

 J> <file>
 J>   <area1>
 J>    <name>John</name>
 J>    <age>22</age>
 J>   </area1>
 J>   <area2>
 J>    <city>London</city>
 J>    <state>OH</state>
 J>   </area2>
 J> </file>

 J> and I only want to output some of the elements.

<xsl:copy-of/>

 J> Maybe all of area1, but none of area2.

[xslt]
<xsl:template match="area1">
    <xsl:copy-of select="."/>
</xsl:template match>

<xsl:template match="area2"/>
[/xslt]

 J> Or all of area1, but just area2/city.

[xslt]
<xsl:template match="area1">
    <xsl:copy-of select="."/>
</xsl:template match>

<xsl:template match="area2">
    <xsl:copy-of select="city"/>
</xsl:template match>
[/xslt]

With best regards, Alex Shirshov.


0
nomail4921 (17)
5/18/2004 2:18:48 PM
Alex Shirshov wrote:

> Hello, Jim!
> You wrote  on Mon, 17 May 2004 14:01:54 -0400:
> 
> 
> [Sorry, skipped]
> 
>  J> How can I ignore elements?  Say I have the xml:
> 
>  J> <file>
>  J>   <area1>
>  J>    <name>John</name>
>  J>    <age>22</age>
>  J>   </area1>
>  J>   <area2>
>  J>    <city>London</city>
>  J>    <state>OH</state>
>  J>   </area2>
>  J> </file>
> 
>  J> and I only want to output some of the elements.
> 
> <xsl:copy-of/>
> 
>  J> Maybe all of area1, but none of area2.
> 
> [xslt]
> <xsl:template match="area1">
>     <xsl:copy-of select="."/>
> </xsl:template match>
> 
> <xsl:template match="area2"/>
> [/xslt]
> 
>  J> Or all of area1, but just area2/city.
> 
> [xslt]
> <xsl:template match="area1">
>     <xsl:copy-of select="."/>
> </xsl:template match>
> 
> <xsl:template match="area2">
>     <xsl:copy-of select="city"/>
> </xsl:template match>
> [/xslt]
> 
> With best regards, Alex Shirshov.
> 
> 

Thanks Alex.  Just what I needed.

Jim

0
no69 (380)
5/19/2004 4:02:29 PM
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 ...

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 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...

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 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. ------------------ =...

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...

Text Editor with XML Output in C#
Hi All, I have agreed to develop a text editor for a special purpose for my company. The editor shall be able to highlight text to indicate special text blocks. The highlighting shall be available to mark different types of text blocks. These text blocks shall be saved then as an XML-Element. I do not want to develop everything from scratch. I am rather looking for components (modules, classes - have to be all free of charge) that I could use in my project. Where can I find knowledge about programming an editor of that kind? What modules or classes could I use to solve my ...

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...

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")) { ...

Sort xml and output xml
I have this xml-file. I want to sort it, and create a new xml-file. The result should be identical to the input except that it's sorted. <?xml version="1.0" encoding="UTF-8"?> <levelone> <child ID="1" sort="5"><name>Paul</name></child> <child ID="2" sort="1"><name>Adam</name></child> <child ID="3" sort="2"><name>Will</name></child> <root> I now want to apply an xslt file and have the following output: <?xml version="1.0" encoding="UTF-8"?> <levelone> <child ID="2" sort="1"><name>Adam</name></child> <child ID="3" sort="2"><name>Will</name></child> <child ID="1" sort="5"><name>Paul</name></child> <root> I've been searching for hours, but all the examples I have seen creates an HTML file. tia /jim Jim Andersen wrote: > I have this xml-file. I want to sort it, and create a > new xml-file. The result should be identical to the > input except that it's sorted. Since you failed to mention what you're using for processing, I assume it's some XSLT 1.0-compliant processor. > <?xml version="1.0" encoding="UTF-8"?> > <levelone> > <child ID="1" sort="5&quo...

How do I deal with new line in text when outputting to XML in Java
Say I have a String in Java like"To be or not to be, that is the question.William Shakespear"How can I convert it to a xml file that has two nodes, each of which contains one line of that string? I mean, how do I program to determine the new line?<dramma> <text>To be or not to be, that is the question.</text> <text>William Shakespear</text></drama> John wrote:> Say I have a String in Java like> > "To be or not to be, that is the question.> William Shakespear"> > How can I convert it to a xml file that ha...

Should the webserver add "Content-Type: text/xml header" to the requested XML file?
I've been informed that a webserver sending a XML file is supposed to add "Content-Type: text/xml header". I'm not questioning that infromation but i'm unsure what was ment by it. The XML i get on my screen when i type in the url to it looks as follows. <?xml version="1.0" encoding="UTF-8"?> <tag-uno>uno</tag-uno> <tag-duo>duo</tag-duo> I can't see any line containing "text/xml" but perhaps it's not supposed to show in the requested file. Please advise. -- Regards Konrad Viltersten ---------------...

embedding xml in xml as non-xml :)
Hi all, I have an application that logs in xml. Assume <xmlLog></xmlLog>. In this element the app logs anything it gets from foreign hosts. Now if the host sends xml data, the structure of the document changes. ie. <xmlLog><somTag></somTag></xmlLog>. This will cause problems with my log reader, because it assumes that <xmlLog/> contains non-xml data. My question is, is there a way to treat the data in the <xmlLog/> element as non xml data. Something I can do that would treat anything this element contains as a literal? Any help or suggestions would be greatly appreciated. Regards, Mark Mark Van Orman <mark@icsaccess.com> wrote: > Hi all, > > I have an application that logs in xml. > > Assume <xmlLog></xmlLog>. In this element the app logs > anything it gets from foreign hosts. Now if the host sends xml > data, the structure of the document changes. ie. > <xmlLog><somTag></somTag></xmlLog>. This will cause problems > with my log reader, because it assumes that <xmlLog/> contains > non-xml data. > > My question is, is there a way to treat the data in the > <xmlLog/> element as non xml data. Something I can do that > would treat anything this element contains as a literal? > > Any help or suggestions would be greatly ap...

how to Update/insert an xml element's text----> (<element> text</element>)
hello friends, how can we update or insert into an xml Element. For example : ------------------- <?xml version="1.0"> <request> <main> <name>ISO8856</name> </main> </request> here when we run a java class file it should replace "ISO8856"with "ISO9001". Any Assistance or example. thanQ in adv. Ajay HANM wrote: > <?xml version="1.0"> > <request> > <main> > <name>ISO8856</name> > </main> > </request> > > here when we run a java class file it should replace "ISO8856"with > "ISO9001". Any Assistance or example. If you use the W3C DOM Level 3 Core as implemented in Java 1.5 and later then you can select the 'name' element and set its textContent e.g. Element name = (Element)xmlDocument.getElementsByTagName("name").item(0); name.setTextContent("ISO09001"); If you use DOM Level 2 Core (as implemente in Java 1.4) then you need to access the firstChild and set its nodeValue Element name = (Element)xmlDocument.getElementsByTagName("name").item(0); name.getFirstChild().setNodeValue("ISO09001"); -- Martin Honnen http://JavaScript.FAQTs.com/ Many good tutorials/articles exist on the web (and some bad ones, alas). I usually point people to http://www.ibm.com/xml -- Joe K...

text classification of speech-to-text output
Can someone please refer me to papers on this subject? Thanks. [ comp.ai is moderated. To submit, just post and be patient, or if ] [ that fails mail your article to <comp-ai@moderators.isc.org>, and ] [ ask your news administrator to fix the problems with your system. ] ...

xml to delimited text
Any suggestions on coverting xml to a delimited text file? I'm looking for a simple client side routine to import xml into MS Access. <Frank> wrote in message news:nuioov4bc2pe96ubkmcf9405e3kqr0j11l@4ax.com > Any suggestions on coverting xml to a delimited text file? I'm > looking for a simple client side routine to import xml into MS Access. If you are looking for suggestions... Here is one: Use XSL. ;-) If you want more specific answers ask more specific questions. Martin A fragment of the XML document would look like the following: <recording> <video> <name>Gone With The Wind</name> <star>Clark Gable</star> <year_released>1950</year_released> </video> </recording> The resulting delimited text file would look like this: Gone With The Wind, Clark Gable, 1950, I assume that I would need an application to strip the XML tag names from the original document and not a process using XSLT. Is this correct? The commas are immaterial. All I want to do is to be able to feed the contents of an XML document into an Access database. What do I use to do this. On Wed, 15 Oct 2003 12:00:06 +0200, "Martin Boehm" <ng.tomalak@arcor.de> wrote: ><Frank> wrote in message news:nuioov4bc2pe96ubkmcf9405e3kqr0j11l@4ax.com > >> Any suggestions on coverting xml to a delimited text file? I'm >> looking for a simple client side routine to import xml...

XML Software Text
http://www.richworld8.blogspot.com/ ...

XML text to HTML
When I have XML text data like the following.. ------ XML Snippet ----- <TEXT> Hello, XML &amp; Java Newsgroup! </TEXT> ------------------------ I hope to get the following html ------- HTML Sinppet ----- Hello,<BR/> XML&nbsp;&amp;&nbsp;Java&nbsp;Newsgroup!<BR/> -------------------------- I tried a java extension, which just replaces &,whitespace and new line(\n) to their corresponding html elements then, get the text from the method with <xsl:value-of select="tth:textToHtml(.)"/> But failed, because Xalan prints html like ------------------------- Hello,&lt;BR/&gt; XML&amp;nbsp;&amp;amp;&amp;nbsp;Java&amp;nbsp;Newsgroup!&lt;BR/&gt; -------------------------- I use Xalan for transforming. How can I get the correct html from xml text? Regards, KwonNam. The answer is <xsl:value-of select="tth:textToHtml(.)" disable-output-escaping="yes"/> :) Son KwonNam �� ��: > When I have XML text data like the following.. > ------ XML Snippet ----- > <TEXT> > Hello, > XML &amp; Java Newsgroup! > </TEXT> > ------------------------ > > I hope to get the following html > ------- HTML Sinppet ----- > Hello,<BR/> > XML&nbsp;&amp;&nbsp;Java&nbsp;Newsgroup!<BR/> > -------------------------- > > I tried a java extension, which just replaces &,whitespace and new > line(\n) t...

Query xml with text()
Hi, i've some problems when i use text() on page http://orario.trenitalia.com/b2c/TimeTable?stazin=fewfw&stazout=roma&datag=04&datam=07&dataa=2008&timsh=15&timsm=09&x=20&y=7&lang=it&nreq=5&channel=tcom if i do //B/text() it returns to me "Stazione di partenza: nessuna stazione corrisponde ai criteri di ricerca impostati." but if i try to do //B[text()="Stazione di partenza: nessuna stazione corrisponde ai criteri di ricerca impostati."] it doesn't found any element. i'm using the library javaXpCom to do the query on the webpage. What's wrong on this query? Thanks and sorry for my bad english Ciccio Pasticcio wrote: > Hi, > > i've some problems when i use text() > > on page > http://orario.trenitalia.com/b2c/TimeTable?stazin=fewfw&stazout=roma&datag=04&datam=07&dataa=2008&timsh=15&timsm=09&x=20&y=7&lang=it&nreq=5&channel=tcom > if i do //B/text() it returns to me "Stazione di partenza: nessuna stazione > corrisponde ai criteri di ricerca impostati." > but if i try to do //B[text()="Stazione di partenza: nessuna stazione > corrisponde ai criteri di ricerca impostati."] it doesn't found any element. Maybe it is an issue with leading and/or trailing white space. The source of that page contains <b>Stazione di partenza: nessuna stazione corrisponde ai criteri di ricerca impos...

XML sample texts?
I'm looking for some XML sample texts to use for testing on a tool set. They won't be made available or public or anything, simply for personal use. Does anyone know where I could find some like this? I need small (~1KB), medium (~100KB), and large (~1MB) documents. It would be excellent to find HTML and TXT versions of the same files, but it's not necessary. Thanks so much! Chris "aechris" <aechris@3pm.ca> wrote in message news:ff361d89.0308140602.634e6ec2@posting.google.com... > I'm looking for some XML sample texts to use for testing on a tool > set. They won't be made available or public or anything, simply for > personal use. Does anyone know where I could find some like this? I > need small (~1KB), medium (~100KB), and large (~1MB) documents. > > It would be excellent to find HTML and TXT versions of the same files, > but it's not necessary. Thanks so much! > > Chris http://www.ibiblio.org/xml/examples contains few docs. http://www.w3.org/XML/Test/ contains XML testsuites etc. hope this helps, Toni Uusitalo ...

Parsing text to XML
This might seem like a stupid question, but I can't seem to find the answer. I've got a table full of information that I want to get into an XML format. I have a schema for the format and I can pretty much manipulate the table however needs to get it into XML. Is it possible to do this without writing code? If so, what tools would I use? Thanks =========================================================================== Chris "Chris Dubea" <cdubea@movingpart.com> wrote in message news:gr5sv1l6a3bpt6vv6cbdb1qe0vojkrcv88@4ax.com... > This might seem like a stupid question, but I can't seem to find the > answer. > > I've got a table full of information that I want to get into an XML > format. I have a schema for the format and I can pretty much > manipulate the table however needs to get it into XML. > > Is it possible to do this without writing code? If so, what tools > would I use? > Have a look at the flat-to-XML examples in http://servingxml.sourceforge.net/. Regards, Daniel Parker > Is it possible to do this without writing code? If so, what tools > would I use? SOMETHING has to read the existing data and massage it into the new format. That something may be you, if you're willing to pound on it by hand, in which case all you need is a text editor. Or, if it's currently in a sufficiently simple format and is going into a sufficiently simple format, a simple pattern-match-and-repl...

convert text to xml
Hello All, I am just learning XML. I need your help in converting a text file to XML. The text file is not a delimited one for me to do the things easily. for eg. a sample file could be like... First Name : abcd Last Name : xyz Content : This is a sample text. It can contain - Anything - something - Nothing Start Time : 12/08/2006 14:50 The XML should be like <Root> <FirstName>abcd</FirstName> <LastName>xyz</LastName> <Content>This is a sample text. It can contain - Anything - something - Nothing </Content> <STime>12/08/2006 14:50</STime> </Root> And with this XML, i need to use XSL to display the contents in a table (HTML Format). Except the other elements, i find difficult to parse the "Content" as i need to display as it is. When i use <value-of select="Content">, i get the contents in a single line but i need to display it as it is in multiple lines Thanks in advance for your help. Regards, Neeraja neeraja.ram@gmail.com wrote: > I need your help in converting a text file to > XML. The text file is not a delimited one for me to do the things > easily. Easiest option is to re-write the file generator so that it makes the output in XML. If you can't do that, then set your time machien for 10 years ago and do it with Perl (or Python), as we u...

Web resources about - XML to text output - comp.text.xml

Output - Wikipedia, the free encyclopedia
... removing irrelevant information, or splitting the article into multiple articles. Specific concerns may appear on the talk page . Output is ...

Resume Star: Pro CV Maker and Resume Designer with PDF Output to Help You Score that Job Interview and ...
Get Resume Star: Pro CV Maker and Resume Designer with PDF Output to Help You Score that Job Interview and Advance your Career on the App Store. ...

Robin refactoring client workshop output - Flickr - Photo Sharing!
Explore Lars Plougmann's photos on Flickr. Lars Plougmann has uploaded 14970 photos to Flickr.

The benefits of wide gamut working spaces on printed output - YouTube
This three part, 32 minute video covers why a wide gamut RGB working space like ProPhoto RGB can produce superior quality output to print. Part ...

Opec oil output keeps rising faster than demand
... bpd in April at 31.2 million bpd – the highest since September 2012, and nearly 1.4 million bpd above the same time last year. Opec’s oil output ...

Madness diminished output of John Nash, mathematical genuis
ALthough recurrent periods of schizophrenia diminished mathematician John Nash's output, his work on game theory was to have ongoing repercussions. ...

China output growth sinks to five-year low
... its lowest level for more than five years, official data for the world's second-largest economy shows. The figure, which measures output at ...

Oil prices surge as Iran shows support for output freeze
Global oil prices rose as much 8 per cent on Wednesday, after Iran voiced support for a Russia-Saudi-led move to freeze production in an oversupplied ...

Adobe updates Lightroom for iOS w/ full-res image output, expanded 3D Touch support, more
... and iPad today which includes one highly requested feature. Starting with versions 2.2 , Lightroom for iOS supports full resolution image output. ...

Oil prices surge as Iran shows support for output freeze
Global oil prices rose as much 8 per cent on Wednesday, after Iran voiced support for a Russia-Saudi-led move to freeze production in an oversupplied ...

Resources last updated: 3/14/2016 12:50:11 AM