-
Notifications
You must be signed in to change notification settings - Fork 5
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
XSLT to add @xml:id to elements that don't have them? #32
Comments
Suggested answer that may get you part of the way there:
|
For more info: https://www.w3schools.com/xml/func_generateid.asp |
One more question, how would I go about copying the processing instructions? Considering that most of the documents I'll be working with will be in TEI and have namespace declarations. |
My "copy-all" stylesheets usually include the additional template:
(Which copies comments as well as processing instructions, as is probably obvious.) |
So this would be a sample XML file
So what I'd be interested in is an XSLT file that looks at all
<p>
elements, checks to see if an@xml:id
exists, if one doesn't, to add and generate one.So the transformed XML file would look like below, but with the understanding the
@xml:id
might be another generated ID (so as to keep things simple).The text was updated successfully, but these errors were encountered: