xsl-list
[Top] [All Lists]

[xsl] Streaming and grouping in XSLT 3.0

2017-03-21 05:43:57
Hi all,

fistly I must admit I'm a complete novice when it comes to XSLT 3.0
and streaming (though not XSLT 2.0).

My use case is as follows -- a triplestore returns streaming RDF/XML
(omitting namespaces):

<rdf:RDF>
  <rdf:Description rdf:about="http://dbpedia.org/resource/Copenhagen";>
    <dct:title>Copenhagen</dct:title>
  </rdf:Description>
  ...
  <rdf:Description rdf:about="http://dbpedia.org/resource/Copenhagen";>
    <dbo:country rdf:resource="http://dbpedia.org/resource/Denmark"/>
  </rdf:Description>
  ...
</rdf:RDF>

Since it's streaming, every resource description only contains one
property. It's not convenient, so during the first pass I group the
descriptions by subject using [1]:

<rdf:RDF>
  <rdf:Description rdf:about="http://dbpedia.org/resource/Copenhagen";>
    <dct:title>Copenhagen</dct:title>
    <dbo:country rdf:resource="http://dbpedia.org/resource/Denmark"/>
  </rdf:Description>
  ...
</rdf:RDF>

Then as the second pass I do the main transformation to XHTML, which
could produce something like using [2][3]

<fieldset>
  <label>Title</title>
  <input type="text" value="Copenhagen"/>
  <label>Country</title>
  <input type="text" value="http://dbpedia.org/resource/Denmark"/>
  ...
</fieldset>

where fieldsets represent resources, and labels/inputs represent
properties/values.

Now my question is, how do I even begin analyzing the streamability of
this approach in XSLT 3.0? I guess my main concern is that such
grouping would not be streamable, but maybe there are other solutions?

Thanks.

Martynas


[1] 
https://github.com/AtomGraph/Web-Client/blob/master/src/main/webapp/static/com/atomgraph/client/xsl/group-sort-triples.xsl
[2] 
https://github.com/AtomGraph/Web-Client/blob/master/src/main/webapp/static/com/atomgraph/client/xsl/bootstrap/2.3.2/layout.xsl
[3] 
https://github.com/AtomGraph/Web-Client/blob/master/src/main/webapp/static/com/atomgraph/client/xsl/bootstrap/2.3.2/imports/default.xsl
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>