Skip to content

Commit

Permalink
#9 more doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 4, 2021
1 parent d40679b commit a71a764
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
25 changes: 25 additions & 0 deletions src/main/resources/org/polystat/far/taus-to-tree.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="taus-to-tree" version="2.0">
<!--
This XSL simply converts textual representation of options into
XML-tree format. For example, this XML:
<o name="foo">
<o line="3" name="a">
<opts>
<opt m="xx" x="\any">{饾湉4:1=1} {饾湉3:2=1}</opt>
</opts>
</o>
</o>
Will turn into:
<o name="foo">
<o line="3" name="a">
<opts>
<opt m="xx" x="\any">
<tau i="4:1">1</tau>
<tau i="3:2">1</tau>
</opt>
</opts>
</o>
</o>
-->
<xsl:strip-space elements="*"/>
<xsl:template match="opt[not(empty(text()))]">
<xsl:copy>
Expand Down
30 changes: 29 additions & 1 deletion src/main/resources/org/polystat/far/unmatch-data.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,35 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="match-data" version="2.0">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="unmatch-data" version="2.0">
<!--
This XSL will find attributes that are data and will put "N"
into their TAU texts. For example, this XML:
<o name="foo">
<o line="3" name="a" data='42'>
<opts>
<opt m="xx" x="10">
<tau i="4:1">1</tau>
<tau i="3:2">1</tau>
</opt>
</opts>
</o>
</o>
Will turn into (because 42 doesn't equal to 10):
<o name="foo">
<o line="3" name="a" data='42'>
<opts>
<opt m="xx" x="10">
<tau i="4:1">N</tau>
<tau i="3:2">N</tau>
</opt>
</opts>
</o>
</o>
-->
<xsl:strip-space elements="*"/>
<xsl:param name="never"/>
<xsl:template match="tau">
Expand Down

0 comments on commit a71a764

Please sign in to comment.