Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making conversion dead simple in xproc ... #7

Open
ndw opened this issue Feb 10, 2016 · 0 comments
Open

making conversion dead simple in xproc ... #7

ndw opened this issue Feb 10, 2016 · 0 comments

Comments

@ndw
Copy link
Collaborator

ndw commented Feb 10, 2016

xml to csv

<address xmlns="http://www.example.org/address" id="1">
    <name>Ola Nordmann</name>
    <address>Langgt 23</address>
    <city>4000 Stavanger</city>
    <country>Norway</country>
</address>
namespace "http://www.example.org/address";

("some.xml")
-> text{ {$_/@id},{$_/name},{$_/country}}

should yield

1,"Ola Nordmann","Norway"

though this works only if each document is an xml document with an address root.

Its an open question about how to handle 'foreach' in these scenarios or if we are able to perform xpath filter on the input, like the following:

("some.xml")/address

Which is roughly equivalent to old syntax @select on p:input.

csv to xml

GID,Name,Country
1,Henry,UK
2,Alex,USA
namespace "http://www.example.org/address";

("some.csv")
-> ?

How can we make text selection easier in this scenario to yield the following ?

<wrapper xmlns="http://www.example.org/address">
<address id="1">
<name>Henry</name>
<country>UK</country>
</address>
<address id="2">
<name>Alex</name>
<country>USA</country>
</address>
</wrapper>

We can imagine other conversion scenarios that pose similar questions:

  • triples to xml
  • xml to triples
  • json to xml
  • xml to json

as well as questions surrounding 'exclude-inline-prefixes' and what 'expand-text' may mean in our new syntax. I propose we add this to next meeting agenda item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant