Skip to content

Instantly share code, notes, and snippets.

@mkraetke
Created August 18, 2022 11:24
Show Gist options
  • Save mkraetke/7c71ef2bbfdb55094f56651633caf3f8 to your computer and use it in GitHub Desktop.
Save mkraetke/7c71ef2bbfdb55094f56651633caf3f8 to your computer and use it in GitHub Desktop.
XProc pipeline with p:insert and language tagging.
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:c="http://www.w3.org/ns/xproc-step"
version="1.0">
<p:input port="source">
<p:inline>
<doc xml:lang="de-DE">
<p>Ein deutscher Textschnipsel.</p>
</doc>
</p:inline>
</p:input>
<p:output port="result"/>
<p:insert match="/doc" position="first-child">
<p:input port="insertion" select="/doc/p">
<p:inline>
<doc xml:lang="en-EN">
<p>An English text snippet.</p>
</doc>
</p:inline>
</p:input>
</p:insert>
</p:declare-step>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment