0

I am writing test files that test functionality of an XSLT library. For this, I embed tiny XSLTs in the XML file itself so that I don't need a separate XML and XSLT file for each test. This looks somewhat like this:

<?xml-stylesheet type="text/xsl" href="#test"?>
<someXml xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <test feature="lib:someFeature(...)">
    <xsl:stylesheet version="2.0" xml:id="test">
      <xsl:import href="../testlib.xsl"/>
      <xsl:template match="*[lib:assertRef(@label, lib:someFeature())]" mode="assert"/>
    </xsl:stylesheet>
  </test>
  <someContent label="assert: #someId"/>
  <someMoreContent xml:id="someId"/>
</someXml>

Is there a way in oXygen to debug this? Does oXygen have a way to run transformations based on the <?xml-stylesheet?> rules at all? Usually, this is not much of a problem as the referenced stylesheet can be run explicitly, but when the stylesheet is embedded, it's something different.

Thomas W
  • 14,757
  • 6
  • 48
  • 67
  • I tested successfully with Saxon 9.7 HE from the command line that your approach together with the `-a` command line option runs the embedded stylesheet, however oXygen does not seem to support or understand the `href="#test"`. You might want to ask in their support forum whether they consider that a bug or accept it as a feature request for future versions or whether there is some configuration to make it work. – Martin Honnen Jan 17 '17 at 16:54
  • Thanks for confirming my suspicon that oXygen doesn't seem to have a feature for this. My test process in fact uses Saxon to go through all the test files using the`-a` option. – Thomas W Jan 17 '17 at 17:19
  • 2
    Indeed Oxygen does not support this way of embedding stylesheets in the XML. I will add an issue in our internal issues list. Oxygen does not use Saxon from the command line so we need to see if Saxon has API to run an XML with an XSLT specified in its own contents. – Radu Coravu Jan 18 '17 at 07:11
  • @RaduCoravu Your first-hand feedback is highly appreciated. – Thomas W Jan 19 '17 at 09:22

1 Answers1

0

As confirmed by oXygen developer @RaduCoravu, this is not possible at the moment.

Thomas W
  • 14,757
  • 6
  • 48
  • 67