Accessing Parameters in XPROC Script
Questions about XML that are not covered by the other forums should go here.
Accessing Parameters in XPROC Script
Hello, I'm still quite new to XML in general, so I'm not even sure if I'm asking the right question! But I'm hoping someone can point me in the right direction.
I'm trying to combine multiple steps of XSL stylesheets in an XPROC script for transforming data into multiple outputs. The data is currently in various text files - each text file will go through the same XPROC script, producing multiple outputs for each one. My first step pulls in the data from the text file and runs the first XSL transformation fine. The only problem is, I can't seem to figure out a way to create the XPROC script without hardcoding in the filename of the text file. Here's what I have:
This works great on my 'example.txt' file, but to run it on another file, I have to actually change the 'example.txt' filename in the script. I just can't seem to figure out how to have that created dynamically. I assumed that this would be a good case for a parameter passed into the XPROC script, but I've tried reading everything I can on XPROC parameters, and the OxygenXML XPROC Transformation Scenario configuration, and I simply can't wrap my head around how to make this work.
If anyone can offer any advice at all, I'd greatly appreciate it!
I'm trying to combine multiple steps of XSL stylesheets in an XPROC script for transforming data into multiple outputs. The data is currently in various text files - each text file will go through the same XPROC script, producing multiple outputs for each one. My first step pulls in the data from the text file and runs the first XSL transformation fine. The only problem is, I can't seem to figure out a way to create the XPROC script without hardcoding in the filename of the text file. Here's what I have:
Code: Select all
<?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="3.0">
<p:input port="source"/>
<p:input port="parameters" kind="parameter"/>
<p:output port="result"/>
<p:xslt name="step1">
<p:input port="source">
<p:data href="example.txt" wrapper="wrapperElement" wrapper-namespace="http://randomnamespace.org" wrapper-prefix="rns"/>
</p:input>
<p:input port="stylesheet">
<p:document href="step1.xsl"/>
</p:input>
<p:input port="parameters">
<p:empty/>
</p:input>
</p:xslt>
</p:declare-step>
If anyone can offer any advice at all, I'd greatly appreciate it!
Re: Accessing Parameters in XPROC Script
Feel free to disregard this question. I changed up some workflow concepts, and was actually able to figure out a way to do what I needed entirely within XSL, with no need for XPROC.
Re: Accessing Parameters in XPROC Script
Hello,
Maybe you can try to use the <p:for-each> step, that lets you perform a series of steps (a subpipeline) to all of the input documents you provide to it.
Unfortunatelly we do not have enough knowledge about this in order to offer you a sollution.
I recommend you to address this question on the XSLT list: xsl-list@lists.mulberrytech.com or at the XProc list: xproc-dev@w3.org
Regards,
Mircea.
Maybe you can try to use the <p:for-each> step, that lets you perform a series of steps (a subpipeline) to all of the input documents you provide to it.
Unfortunatelly we do not have enough knowledge about this in order to offer you a sollution.
I recommend you to address this question on the XSLT list: xsl-list@lists.mulberrytech.com or at the XProc list: xproc-dev@w3.org
Regards,
Mircea.
Mircea Enachescu
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Thu May 20, 2021 2:28 pm
Re: Accessing Parameters in XPROC Script
Post by crawford47 »
Yes, <p:for-each> step is definitelly working.
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service