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

XPath in names of element/attribute specs #22

Open
michmech opened this issue Oct 16, 2017 · 0 comments
Open

XPath in names of element/attribute specs #22

michmech opened this issue Oct 16, 2017 · 0 comments

Comments

@michmech
Copy link
Owner

Suppose I have an XML document like this:

<data type="name">John Smith</data>
<data type="date-of-birth"><day>12</day><month>10</month><year>1935</year></data>

I want to be able to tell Xonomy that the <data> element contains text if @type="name" and that it contains child elements like <day> etc, if @type="date-of-birth".

You can do these things with Xonomy already by giving the various properties of the <data> element specification as functions rather than literal values. But it's complex and messy. It would be easier (for the docspec author) to be able to create two different element specifications for these two XPath expressions:

data[@type="name"]
data[@type="date-of-birth"]

(Originally suggested by Morgan Cundiff of Library of Congress.)

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

No branches or pull requests

1 participant