are there XML-based formats for…


I

Ivan Shmakov

I wonder, are there any generic XML-based formats to express:

• time spans (RFC 3339-based, preferrably);

• message digests (SHA-1, SHA-2, etc.) computed over “chunks†of
binary data;

• the results of the Unix stat(3) system call [1];

• XML transformation “modules†and their respective
interdependencies; (this feels somewhat related to XProc [2],
but not quite.)

Like, for example:

<some:container>
<xt:timespan>
<xt:begin>2010-04-29T17:59:18+00:00</xt:begin>
<some:element />
<xt:end>2010-04-29T18:00:32+00:00</xt:end>
</xt:timespan>
</some:container>

<some:container>
<xc:chunkset>
<xc:chunk offset="0" length="4096">
<xc:digest>
<!-- borrowed from http://www.w3.org/TR/xmldsig-core/ -->
<xc:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<xc:DigestValue
>VweSIbNEl2P2r6lm+OL7hVJTwt8=</xc:digestvalue>
</xc:digest>
</xc:chunk>
<!-- … -->
<xc:chunk offset="61440" length="4096">
<!-- … -->
</xc:chunk>
</xc:chunkset>
</some:container>

<some:container>
<xs:stat>
<xs:device>0xfe02</xs:device>
<xs:inode>1261572</xs:inode>
<xs:links>3</xs:links>
<xs:type>directory</xs:type>
<xs:size>4096</xs:size>
<xs:atime>2010-04-29T18:15:45+00:00</xs:atime>
<xs:ctime>2010-04-28T04:11:19+00:00</xs:ctime>
<xs:mtime>2010-04-28T04:11:19+00:00</xs:mtime>
<xs:uid>1000</xs:uid>
<xs:gid>1000</xs:gid>
<xs:mode>0755</xs:mode>
</xs:stat>
</some:container>

<some:container>
<xm:module
uri="http://example.invalid/make-toc.xsl">
<xm:depends>
<!-- doesn't have a ToC already -->
<xm:condition test="not (/descendant::mad:id = 'toc')" />
<!-- has at least 3 sections -->
<xm:condition test="/descendant::xhtml:h2 [position = 3]" />
</xm:depends>
<xm:may-provide>
<xm:identifier>toc</xm:identifier>
</xm:may-provide>
</xm:module>
</some:container>

[1] http://www.opengroup.org/onlinepubs/000095399/functions/stat.html
[2] http://www.w3.org/TR/xproc/
 
Ad

Advertisements

J

Joe Kesselman

Ivan said:
• time spans (RFC 3339-based, preferrably);

XML Schema has "duration" types.
• message digests (SHA-1, SHA-2, etc.) computed over “chunks†of
binary data;
> • the results of the Unix stat(3) system call [1];

Those two have not been standardized as far as I know. That doesn't mean
nobody has done it, of course, just that I haven't seen anything widely
agreed upon.
• XML transformation “modules†and their respective
interdependencies; (this feels somewhat related to XProc [2],
but not quite.)

Several versions of this have been done, I believe, but again I don't
think any of them have become clear leaders. I haven't played with them
so I don't have valid opinions on their strengths and/or weaknesses.

--
Joe Kesselman,
http://www.love-song-productions.com/people/keshlam/index.html

{} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
/\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
 
I

Ivan Shmakov

> XML Schema has "duration" types.

Thanks for the pointer! Actually, I'd rather need a couple of
“dateTime†instances.
>> • message digests (SHA-1, SHA-2, etc.) computed over “chunks†of
>> binary data; • the results of the Unix stat(3) system call [1];
> Those two have not been standardized as far as I know. That doesn't
> mean nobody has done it, of course, just that I haven't seen anything
> widely agreed upon.

In particular, XML Signature Syntax and Processing [1] provides
such elements. I wonder, should I stick to the elements defined
there or should I define my own elements to mimic the behavior?

[1] http://www.w3.org/TR/xmldsig-core/
>> • XML transformation “modules†and their respective
>> interdependencies; (this feels somewhat related to XProc [2], but
>> not quite.)
> Several versions of this have been done, I believe, but again I don't
> think any of them have become clear leaders. I haven't played with
> them so I don't have valid opinions on their strengths and/or
> weaknesses.

The problem with XProc [2] is that it specifically prohibits
loops:

--cut--
2.4 Connections

Steps are connected together by their input ports and output ports.
It is a static error (err:XS0001) if there are any loops in the
connections between steps: no step can be connected to itself nor
can there be any sequence of connections through other steps that
leads back to itself.
--cut--

While what I'm trying to accomplish is the processing of the XML
infoset by a set of modules, automatically ordered in a way that
satisfies the dependencies (or other constraints) as specified.
And this may imply repeated processing of the infoset by a
single module.

[2] http://www.w3.org/TR/xproc/
 
Ad

Advertisements

J

Joe Kesselman

Ivan said:
While what I'm trying to accomplish is the processing of the XML
infoset by a set of modules, automatically ordered in a way that
satisfies the dependencies (or other constraints) as specified.
And this may imply repeated processing of the infoset by a
single module.

Depending on what you're doing, "repeated processing" may not require
loops, you know -- if you know the maximum number of passes that will be
required, you can make them explicit, possibly with some of them being
conditional



--
Joe Kesselman,
http://www.love-song-productions.com/people/keshlam/index.html

{} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
/\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
 

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

Top