Non-XML tagged value text to XML
I would like to use XSLT to translate some tagged value text to XML
elements like this:
<data>x=1.234 y=ABC z="Hello World"</data>
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
> 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:
> <z>"Hello World"</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
Using XSLT 2.0 you can do that with regular expression matching as follows:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:template match="data"...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...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...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:
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
Any help you're willing to provide would be greatly appreciated.
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
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
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...file command: "XML document text" vs "XML document text"
I've just used the file command on four files of RDF-XML with the
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"
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 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 ...embedding xml in xml as non-xml :)
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.
Mark Van Orman <email@example.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...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 '<', '>' becomes '>'). 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?
On Thu, 2 Nov 2005 firstname.lastname@example.org wrote:
> In my program, I get input from the us...extract plain-text from xml-file / remove all tags
For feeding the content of an xml-file to a search-indexer I need to
remove all tags and extract the plaintext out of a xml-file.
I use the null-xls-stylesheet
to remove all tags.
Problem now is that, while it actually works, I found out that removing
all tags is not exactely what I want, cause I ended up with all content
in one string without any whitespace in between. So actually what i want
is to replace all tags with a space.
I use linux/xsltproc/perl and I am definitely no master of xml. I rarely
used it until now and while I do quite fine in perl, I cannot master
this simple xml-problem on my own
thnx for any help
In article <email@example.com>,
peter pilsl <firstname.lastname@example.org> wrote:
>Problem now is that, while it actually works, I found out that removing
>all tags is not exactely what I want, cause I ended up with all content
>in one string without any whitespace in between. So actually what i want
>is to replace all tags with a space.
As usual, you should start with an identity stylesheet:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</xsl:cop...How to retrieve XML CDATA text contents by org.xml.sax.ext.DefaultHandler2?
For example I have a XML tag
My script is here
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?
public void startElement(String uri, String localName, String qName,
// How to retrieve my script contents?
public void endElement(String uri, String localName, String qName)
...extracting text from an XML node
suppose i get the simple xml sample:
Now suppose i want to extract all the text of only the 'foo' node, ie
expected result is '1 3'.
I tried both
<xsl:value-of select="text()" />
<xsl:value-of select="." />
but the former lead to '1' and the latter to '1 2 3' (using xsltproc &
What did i missed ?
> Now suppose i want to extract all the text of only the 'foo' node
That isn't a built-in concept; you have to recast it as "all the text
nodes which are immediate children of the 'foo' node". (The built-in
text value of an element, as you discovered, is the value of all text
contained in it, directly or indirectly). Note too that the whitespace
(line breaks and indentation) will be part of the the text nodes unless
you explicitly strip that away.
<xsl:value-of select="text()" />
didn't work because value-of returns the contents of only the first
matching node. This is one case where xsl:for-each is appropriate, to
explicitly iterate through the text children.
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
On Nov 30, 12:34 am, Joseph Kesselman <kesh...How do I color text with XML tags?
I am trying to display some XML-tagged text in a web page. The
following example works well in Netscape 7.1, but only the H2 heading
is colored in MSIE. It seems that MSIE only applies style attributes
to tags that it recognizes.
Is there a way in which this can be done? Is it possible to format
the XML part (from <azTagger> to </azTagger>) with XLS? If so, how?
======== START OF HTML FILE ===========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<style ...[XML] Is there an XML group?
I've typed an XML source which calls a CSS source, the result should be
a page displayed in IE6,
instead I see the XML source.
That's pretty logical since there a no XHTML tags for IE6 to interpret.
I'm looking for a discussion group like'comp.lang.xml' but I can't find
Please help me.
The first task is to see the Blue Jay.
> I'm looking for a discussion group like'comp.lang.xml' but I can't find
There's a comp.text.xml, which might be what you're looking for.
Note that I don't read it,...XML to XML conversion
I vageuly remember a standard that allowed for an XML document using one
tag vocabulary to be translated to a diffirent XML document using a
diffirent tag vocabulary using the information provided in a kind of
dictionary XML pointed to in an URL present in the original XML file. I
am very interested in trying it out for various applications, but I
can't find anything on the internet about it, since I don't remember
it's name, only the general appearance. Can anyone help me with this?
What I remember, approximately:
The idea is that you have one XML file, in which the namespace is
defined in the standard way, using an URI. The URI, however, is pointing
to an online XML file. For example:
This dictionary.xml then contains, for example:
So a program wishing to convert the original XML to, say format2, would
end up with the following XML:
What I remember is that this dictionary trick was mainly used to allow
diffirent software to be able to interpret the same XML file, without
all of the software needing to be programmed for the same tag
vocabulary. The program w...xml from 2 xml
Hi to everybody,
would I like to create a consequential xml from the elaboration of two
files xml using xslt, but is it possible to give in input to a trasform
2 files xml?
thanks for the possible answers
I have already found from me the answer: the function
matatu ha scritto:
> Hi to everybody,
> would I like to create a consequential xml from the elaboration of two
> files xml using xslt, but is it possible to give in input to a trasform
> 2 files xml?
> thanks for the possible answers
...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.
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" <email@example.com> wrote in message
> 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.
> 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...Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser)
I'm subject to some confusion with XML and UTF8. I'm working with
XML-Simple and I try to decode some XML with with german umlauts
(ISO-8859-1). The first XML line declared the encoding correct (see code
below). But I'm getting different results using XML-Simple with the
default XML parser named XML::Sax and a second parser named XML::Parser.
The following code tries to decode the mini XML file and prints the UTF8
flags of the resulting strings.
Can someone run this code on his machine and post the results? Thanks.
The results on my machine are this:
���ä...no tags in my xml-to-xml transformation, help....
my xml-to-xml transformation is outputting an xml header and then just
text like this:
<?xml version="1.0" encoding="iso-8859-1"?>e19dbb7b-5529-43a0......
I've searched regarding this problem and it seems that if there's no
match in your xsl template then by default everything gets spat out.
But I've tested this with very definite matches in my template, and
still there are no xml tags in the output.
Has anyone seen this before? Any help much appreciated....
> my xml-to-xml transformation is outputting an xml header and then just
> text like this:
> <?xml version="1.0" encoding="iso-8859-1"?>e19dbb7b-5529-43a0......
> I've searched regarding this problem and it seems that if there's no
> match in your xsl template then by default everything gets spat out.
> But I've tested this with very definite matches in my template, and
> still there are no xml tags in the output.
> Has anyone seen this before?
We do not need to guess, try to reduce to the minimum necessary to show
the problem, then post the relevant XML and XSLT here, and tell us which
XSLT processor you use.
Ok, false alarm.
As I suspected, it was a newbie issue. In case anyone else has this
problem, the solution is to use copy-of instead of value-of. Pretty
self-explanatory: value-of will output the va...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:
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
<?xml version="1.0" encoding="UTF-8"?>
I can't see any line containing "text/xml"
but perhaps it's not supposed to show in the
requested file. Please advise.
---------------...[rfc-dist] RFC 6207 on The Media Types application/mods+xml, application/mads+xml, application/mets+xml, application/marcxml+xml, and application/sru+xml
A new Request for Comments is now available in online RFC libraries.
Title: The Media Types application/mods+xml,
application/marcxml+xml, and application/sru+xml
Author: R. Denenberg, Ed.
Date: April 2011
I-D Tag: draft-denenberg-mods-etc-media-types-03.txt
This document specifies media types for the following formats: MODS
(Metadata Object Description Schema), MADS (Metadata Authority
Description Schema), METS (Metadata Encoding and Transmission
Standard), MARCXML (MARC21 XML Schema), and the SRU (Search/Retrieve
via URL Response Format) protocol response XML schema. These are all
XML schemas providing representations of various forms of information
including metadata and search results. This document is not an Internet
Standards Track specification; it is published for informational purposes.
INFORMATIONAL: This memo provides information for the Internet community.
It does not specify an Internet standard of any kind. Distribution of
this memo is unlimited.
This announcement is sent to the IETF-Announce and rfc-dist lists.
T...how to check for existenceof XML tags with XML::Simple?
Using XML::Simple, what's the best way to check for
the existence of a particular XML tag?
For example, lets say I have 2 files, "success.xml" and
"failure.xml" which differ only in their innermost tags
(one being "<responseSuccess>" and the other being "<responseFailed>").
Can I use "exists()" or "defined()" on the path which refers
to that tag?
For example, consider the following:
------ START: success.xml -------
<?xml version="1.0" encoding="UTF-8"?>
...Swing text (XML) view control with autoformat?
We need to display XML files in a Swing GUI. The XML is automatically
generated so it is absolutelly unadapted to human viewing.
So we need some Swing control that can format XML and show it.
Or use some XML formatting tool and display results in simple
JTextPane or something like this.
Michael Yashin wrote:
> We need to display XML files in a Swing GUI. The XML is automatically
> generated so it is absolutelly unadapted to human viewing.
> So we need some Swing control that can format XML and show it.
> Or use some ...XML-tagging text document from W3C-schema
Is there an XML-editor that can assist you in marking up the data in an
urformatted text document, such that you mark the data and then
right-click to access the Schema you have assigned, and choose the
tag/attribute in the tree-structure, which then magically appears with
your data enclosed? There must be, right?
My assignment is to bring order to a truckload of stats from various
Athletics events. For individual meetings, the formatting of the list of
results are fairly standardized, but as a rule, they all follow their
own standard, which means there's no hope making a script to automize
the tagging, since there are several hundred meetings.
I have made a fairly simple schema which covers basicaly what I need in
the way of tags, which is:
<season name="" year="">
<meeting name="" date="" country="" location="" arranger="" arena="">
<event name="" category="">
<participant lastname="" firstname="" born="" club="" result=""
type="" place="" other=""/>
Here's hoping for some suggestions!
A noise annoys an oyster
> Is there an XML-editor that can assist you in marking up the data in an
> urformatted text document, such th...web.xml / XML schema issue, why do some XML schema attributes disappear
I'm trying to get my j2ee app to run on Jboss (version 3.2.3), but
Jboss complains there are some missing attributes in the web-app
element. The attributes are present in the XML file, but they seem to
be removed by the parser, also when I view the file in a web browser.
My XML below (I have cut out a lot of stuff for the purpose of this
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="...Installation of: XML-DOM-1.44, XML-Parser-2.36, XML-RSS-1.47, XML-Simple-2.18
- CPAN Forum Q&A, Installation of;
As concerns the installation of the four items above, these errors are
continously flagged as an intervention to the process;
Checking installed modules... could not find ParseDetails.ini in C:
XML::Sax is installed, it will be used by the test suite
Could not open 'lib/XML/Simple.pm': No such file or directory at C:/
strawberry/perl/lib/ExtUtils/MM_Unix.pm line 2627.