[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ProgSoc] XML languages



Thomas Given-Wilson wrote:
I am trying to find some information on XML programming languages.
Basically, what are the capabilities and limitations of existing
programing languages when it comes to XML. The restriction is that I
want to work with the XML only, e.g. no converting to a Java
representation and working in Java, the programming language must
operate strickly on XML and the XML declared types/properties.
This doesn't make sense to me.

XML [1] is a data format specification. If you have data that is valid XML then its just a set of bits somewhere. In order to operate on XML you need to parse it and load it in to a Document Object Model (DOM) (e.g. [2]... I'm not sure if there's a W3C spec for XML DOMs... I think there is... but... I dunno.).
XML itself (a data format specification) is divorced from DOMs. There 
are various DOMs, and various DOMs standards. You can't process XML 
without a DOM. (Well... you could do text processing... but in that case 
you'd just be working with a very limited 'DOM' (i.e. an array of 
characters)).
You're probably looking for an XSL [3] implementation. The most salient 
component in your case likely being XPath [4], which is a standard 
language for finding nodes.
It is possible to apply XSLT to XML without getting involved in the 
intermediate DOM processing. See here [5] for example. That's an XML 
document with a stylesheet processing instruction:
 <?xml-stylesheet type="text/xsl" href="netfx20-overview.xsl" ?>

If you load this [5] in a modern browser it will apply the stylesheet [6].

[1] http://www.w3.org/XML/
[2] http://www.w3.org/DOM/
[3] http://www.w3.org/Style/XSL/
[4] http://www.w3.org/TR/xpath
[5] http://www.jj5.net/file/2007-02-11-175351/netfx20-overview.xml
[6] http://www.jj5.net/file/2007-02-11-175351/netfx20-overview.xsl

The sorts of programs I have in mind to be running in this language are:
1 - find all elements of type X
//X

2 - find all elements of type X inside a type Y
//Y//X

3 - find all elements of type X that return True from a function f
	(where f is any function that accepts argument X and returns a
	boolean)
You can embed JScript.NET in XSLT templates with the .NET libraries. I 
do this from time to time... it's handy. But... probably not what you're 
looking for.
Sorry... busy today. Must run.












-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@xxxxxxxxxxxxxxxxxxx
If you are having trouble, ask owner-progsoc@xxxxxxxxxxxxxxxxxx for help.