[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] text nodes of document in XDM
- From: "David Lee" <dlee@calldei.com>
- To: "'Michael Kay'" <mike@saxonica.com>, <xml-dev@lists.xml.org>
- Date: Wed, 12 Jan 2011 07:23:38 -0500
Thanks for the clarification.
I didn't realize that the concatenation of adjacent items in a document node
was done at document creation time.
But sure enough,
document { 1 , "hi" , <foo/> , 2 }/node()[1]
results in "1 hi"
But it seems more then just text nodes survive this at construction time
atleast.
I'm able to get PI's and comments as separate nodes within documents
document { 1, <?PI hi?> , <!-- comment --> }/node()[3]
returns <!-- comment -->
And so does
document { 1, text{"hi"} , text{"there"} , <?PI hi?> , <!-- comment -->
}/node()[3]
Assuming theses XQuery constructors produce valid XDM immediately (since I
only serialized the result, not the docment).
My extrapoliation from this is that only atomic and text nodes are
concatenated into text nodes, and other node types where allowed are left as
a sequence,
as part of constructing XDM (not serializing it).
As for use of XDM Serialization, I won't expound on it much further now,
but there are other powerful use cases.
But they do all derive from the requirement of round-tripping XDM ->
serialized -> XDM with minimal loss.
One such use case is an "XDM Resource" stored in a file. (Imagine a mini
XDM database represented as a text file ... )
Another is storing the parameters (or providing as text by another non-xml
process) as well as the input context for a call to xquery, xpath , or xslt
There are others , but yes they all have as a core requirement the ability
to get XDM out of proprietary in-memory representations into a stream and
back with as little change reasonable.
----------------------------------------
David A. Lee
dlee@calldei.com
http://www.xmlsh.org
-----Original Message-----
From: Michael Kay [mailto:mike@saxonica.com]
Sent: Wednesday, January 12, 2011 5:42 AM
To: xml-dev@lists.xml.org
Subject: Re: [xml-dev] text nodes of document in XDM
> By "support" I know that is vague, but I don't have a better word yet.
> I'm trying to reanimate my thinking and work on an XDM Serialization
> specification which is usable for data exchange.
> So for example if I serialize to a stream (or file)
>
> document { 1 , "hi" ,<foo/> , 2 }
>
> then then deserialize that back into XDM values ... how "important" is it
to
> reconstruct the sequence inside the document.
As far as I can see, the only reason anyone would want to use your new
serialization format is because it round-trips any XDM instance losslessly.
I might be prepared to put up with a few restrictions, such as losing
unparsed entities or the base URI property, but not with this one.
Concerning your example
document { 1 , "hi" ,<foo/> , 2 }
that isn't, of course, a representation of an XDM instance. It's a query
whose result would be best represented as
document{ text{"1 hi"}, element {foo}{}, text{"2"} }
Michael Kay
Saxonica
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]