are there XML-based formats for…

Discussion in 'XML' started by Ivan Shmakov, Apr 29, 2010.

  1. Ivan Shmakov

    Ivan Shmakov Guest

    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/

    --
    FSF associate member #7257
    Ivan Shmakov, Apr 29, 2010
    #1
    1. Advertising

  2. Ivan Shmakov wrote:
    > • 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."
    Joe Kesselman, Apr 29, 2010
    #2
    1. Advertising

  3. Ivan Shmakov

    Ivan Shmakov Guest

    >>>>> Joe Kesselman <> writes:
    >>>>> Ivan Shmakov wrote:


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


    > 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/

    --
    FSF associate member #7257
    Ivan Shmakov, May 2, 2010
    #3
  4. Ivan Shmakov wrote:
    > 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."
    Joe Kesselman, May 2, 2010
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sven Steinacker
    Replies:
    1
    Views:
    703
    Johannes Koch
    Oct 27, 2003
  2. Sven Steinacker
    Replies:
    0
    Views:
    659
    Sven Steinacker
    Oct 27, 2003
  3. Matt
    Replies:
    1
    Views:
    354
    Martin Honnen
    Jul 5, 2004
  4. Jim Mitten
    Replies:
    3
    Views:
    414
    Joseph Kesselman
    Jan 29, 2008
  5. Ivan Shmakov

    security vs. XML-based formats

    Ivan Shmakov, Mar 8, 2010, in forum: XML
    Replies:
    4
    Views:
    1,039
    Ivan Shmakov
    Mar 8, 2010
Loading...

Share This Page