XML to XML conversion

Jure Sah

Usenet Archive
Joined
Mar 3, 2005
Messages
19
Reaction score
0
Hello,

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:

<x xmlns:abc="http://www.server.org/dictionary.xml"> <abc:eek:ne>orange</abc:eek:ne> </x>

This dictionary.xml then contains, for example:

<root>
<one>
<format1>1</format1>
<format2>uno</format2>
<format3>ena</format3>
<format4>ein</format4>
</one>
</root>

So a program wishing to convert the original XML to, say format2, would end up with the following XML:

<x>
<uno>orange</uno>
</x>

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 would just have the translations of the tag meanings prepared specialy for it in the dictionary file.

I remember(!) seeing this implemented somewhere and I don't want to create my own standard here even if what I remember was just somebody's bright idea and not an official XML standard. This little trick gives a solution to creating globaly-compatible software when companies that provide XML data sources can't agree on a common tag vocabulary. I need more information so I can implement it's use compatibly.

Anyone?

Thanks in advance.
 

Tjerk Wolterink

Usenet Archive
Joined
Sep 18, 2004
Messages
218
Reaction score
0
Jure said:
Hello,

cut

You should make the tags names language independent.
Only the content should be able to contain different languages.

But back to your question:
Use XSLT.
 

Jure Sah

Usenet Archive
Joined
Mar 3, 2005
Messages
19
Reaction score
0
Tjerk said:
You should make the tags names language independent.
Only the content should be able to contain different languages.

The tag names got nothing to do with what I can do, they are obviously determined by the XML data provider, not by the processor.
But back to your question:
Use XSLT.

I've looked into it and the whole thing reminds me a bit of SQL queries, obviously more suitable for transforming databases than interpreting an XML files in various ways. Nevertheless it appears to be the standard I asked for.

I am curious tho, how to provide an XML file and include (in a standard way) all the intformation required to allow the file to be interpreted by all the programs which's vocabularies we knew about at the time the XML file was written.
 

Patrick TJ McPhee

Usenet Archive
Joined
Apr 2, 2000
Messages
269
Reaction score
0
[...]
% > But back to your question:
% > Use XSLT.
%
% I've looked into it and the whole thing reminds me a bit of SQL queries, % obviously more suitable for transforming databases than interpreting an % XML files in various ways. Nevertheless it appears to be the standard I % asked for.

I don't know why you get that idea. A stylesheet that converts "one" to "uno" is

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

<xsl:template match="*">
<xsl:copy><xsl:apply-templates select ="node|@*"/></xsl:copy> </xsl:template>

<xsl:template match="one">
<uno><xsl:apply-templates select ="node|@*"/></uno>
</xsl:template>

</xsl:stylesheet>

This could be extended to read the names of the elements to transform from some other file.

% I am curious tho, how to provide an XML file and include (in a standard % way) all the intformation required to allow the file to be interpreted % by all the programs which's vocabularies we knew about at the time the % XML file was written.

I'm not sure it makes sense to do this. In any case, if you can depend on all programs supporting XSLT, and supporting the xml-stylesheet PI, the standard way to point an application to a stylesheet is to add something like this:

<?xml-stylesheet href="http://my.machine/path/to/file" type="text/xsl" title="type-of-conversion"?>

before the first element of the document.
 

Peter Flynn

Usenet Archive
Joined
Jan 2, 2000
Messages
1,813
Reaction score
0
Jure said:
The tag names got nothing to do with what I can do, they are obviously determined by the XML data provider, not by the processor.

I've looked into it and the whole thing reminds me a bit of SQL queries, obviously more suitable for transforming databases than interpreting an XML files in various ways.

Er, no. XSLT is designed explicitly for transforming XML documents. It doesn't have anything even remotely to do with databases or SQL.
Nevertheless it appears to be the standard I
asked for.

Actually the more I think about it, the more I'm sure there was some earlier (even pre-XML) system that used translation files like you described. But I may just be having a brain-fart.
I am curious tho, how to provide an XML file and include (in a standard way) all the intformation required to allow the file to be interpreted by all the programs which's vocabularies we knew about at the time the XML file was written.

I don't think that's really what XSLT was designed for. If you're talking about mapping the *interpretation* of markup, that's really a job for something like ISO 11179 or Topic Maps.

///Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,050
Messages
3,104,249
Members
248,133
Latest member
DujonT

Latest Threads

Top