IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: Martin Honnen
About
User Name: Martin Honnen
Forum Rank: Advanced Member
Real Name:
Location
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Sunday, June 10, 2007
Last Visit: Friday, September 28, 2018 3:54:29 PM
Number of Posts: 36
[0.20% of all post / 0.01 posts per day]
Avatar
Last 10 Posts
Topic: Where should I enable and then see an XSLT 3 xsl:assert when running or debugging XSLT 3 in XMLSpy
Posted: Friday, September 28, 2018 3:54:29 PM
Using Altova XML Spy Professional Edition version 2018 rel. 2 SP1 (x64) I wonder where I would see any "xsl:assert" message when running or debugging an XSLT 3 stylesheet.

As far as I understand it from https://www.w3.org/TR/xslt-30/#assertions, "By default, assertions are disabled".

Is there any way in XMLSpy to enable them for the execution and/or debugging of an XSLT 3 stylesheet (with XMLSpy's built-in XSLT 3 engine)?
Topic: XSLT/XQuery for processing JSON
Posted: Wednesday, April 18, 2018 7:55:05 PM
Thanks a lot. Still not sure why the project didn't include the files, but a careful search with file explorer has now also shown that they are in the project folder in the file system, somehow the XMLSpy project file didn't include them.
But thanks again, now with the files I can better understand how the new features presented in the video work.
Topic: XSLT/XQuery for processing JSON
Posted: Wednesday, April 18, 2018 5:11:37 PM
I have just watched the video https://youtu.be/Hd5W6IpDA8Y?t=189 and it shows a subfolder XSLT/XQuery of the JSON examples folder in the Altova 2018 examples, however with my installation of the Altova XMLSpy Professional Edition updated to 2018 release 2 I don't find that XSLT/XQuery subfolder of the JSON Examples folder. Does anyone else have that subfolder in his examples project? Does the update not update that examples project properly?

In general, when transforming a JSON input document with XSLT 3, what is the global context item, what is the initial match selection, does processing start with a named template or by applying a template matching the initial match selection?
Topic: XSLT lookup using regex
Posted: Thursday, September 22, 2016 2:46:05 PM
I don't think a key can solve that but assuming XSLT 2.0 or higher you have regular expression support and can use
Code:

<xsl:value-of select="$LookupDoc/Row[matches($curr_key, @Key1)]/@ElementType"/>
Topic: XSLT lookup using regex
Posted: Wednesday, September 21, 2016 8:27:34 PM
Can you show us the data passed in as $curr_key you want to compare? A key works with an exact value comparison https://www.w3.org/TR/xslt20/#keys with the eq operator so it is not clear what you want to achieve.
Topic: Question about support of XSLT 3.0 support
Posted: Friday, June 17, 2016 1:35:16 PM
I am bit confused about the state of XSLT 3.0 support in the latest XMLSpy release, the section https://www.altova.com/whatsnew.html says

Quote:
Support for additional XSLT 3.0 instructions

A number of new instructions are now supported, including:


Static variables & parameters
Shadow attributes
Pattern matching of any item (not just nodes) - apply-templates for any item
xsl:accumulator
xsl:accumulator-rule
xsl:break
xsl:context-item

xsl:fork
xsl:global-context-item
xsl:iterate
xsl:merge
xsl:merge-key
xsl:merge-action
xsl:merge-source
xsl:next-iteration
xsl:on-completion


so it lists elements like xsl:merge or xsl:fork which are new in XSLT 3.0. On the other hand, when I look at the online manual http://manual.altova.com/XMLSpy/spyprofessional/ and the page http://manual.altova.com/XMLSpy/spyprofessional/index.html?xsxqengine_xslt30.htm it explicitly states

Quote:
The following XSLT 3.0 instructions are currently unsupported:



xsl:accept

xsl:accumulator

xsl:accumulator-rule

xsl:break

xsl:context-item

xsl:expose

xsl:fork

xsl:iterate

xsl:merge
xsl:merge-action
xsl:merge-key
xsl:merge-source
xsl:mode
xsl:next-iteration
xsl:next-match
xsl:on-completion
xsl:override
xsl:package
xsl:stream
xsl:use-package


Has the online documentation not been updated?

If stuff like xsl:merge or xsl:fork is supported, is there also support for streamed XSLT processing, e.g. doing

Code:
xsl:merge-source for-each-stream="'input.xml', 'input2.xml'" select="/root/foo" streamable="yes"


?
Topic: issue with schema validation of string with Unicode characters outside of BMP (basic multilingual pl
Posted: Wednesday, October 17, 2012 5:11:42 PM
I thought the support engineers might read here too and raise a bug in the bug system themselves if they agree on my assessment.
And I am usually struggling to get my bug reports through the bug reporting web site. But I managed on the second attempt to file a related bug on XSLT and will try the same approach for this problem, sorry for the hassle.
Topic: issue with schema validation of string with Unicode characters outside of BMP (basic multilingual pl
Posted: Friday, October 12, 2012 5:45:23 PM
Using
Quote:
AltovaXML Community Edition Version 2013
Copyright (c) 1998-2012 Altova GmbH. All rights reserved.
build: Sep 14 2012, 02:13:05

I am trying to validate the document http://home.arcor.de/martin.honnen/xml/oneCharInstance1.xml against the schema http://home.arcor.de/martin.honnen/xml/oneCharSchema1.xsd. I get the following validation error:
Quote:
The XML data is invalid.
Value '&#x10300;' is not allowed for element <test>.


When I validate the same files with other schema validating XML parsers like Saxon 9.4 EE or like XSV (see result) I get no validation errors.

I think AltovaXML is wrong to report a validation error, in terms of XML a character like &#x10300; is a single XML character and therefore the "test" element is valid against the schema allowing a string of length 1 as the content.
Topic: How do I???
Posted: Wednesday, October 13, 2010 10:41:54 AM
If the input XML is
Code:


<Root>
  <Location>
    <LocationGid>
      <Gid>
        <Xid>Loc1</Xid>
      </Gid>
    </LocationGid>
    <LocationName>Area 1</LocationName>
  </Location>
  <Location>
    <LocationGid>
      <Gid>
        <Xid>Loc2</Xid>
      </Gid>
    </LocationGid>
    <LocationName>Area 2</LocationName>
  </Location>
  <Location>
    <LocationGid>
      <Gid>
        <Xid>Loc3</Xid>
      </Gid>
    </LocationGid>
    <LocationName>Area3</LocationName>
  </Location>
  <Release>
    <ShipFromLocationRef>
      <LocationRef>
        <LocationGid>
          <Gid>
            <Xid>Loc2</Xid>
          </Gid>
        </LocationGid>
      </LocationRef>
    </ShipFromLocationRef>
  </Release>
</Root>

then this stylesheet
Code:

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="2.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="xs">
 
  <xsl:output method="text"/>
 
  <xsl:key name="k1" match="Location" use="LocationGid/Gid/Xid"/>
 
  <xsl:template match="/">
    <xsl:value-of select="key('k1', /Root/Release/ShipFromLocationRef/LocationRef/LocationGid/Gid/Xid)/LocationName"/>
  </xsl:template>

</xsl:stylesheet>

outputs
Code:
Area 2


So using xsl: key and the key function is the right way with XSLT to process cross-references in an XML document.
Topic: format-number error
Posted: Wednesday, September 1, 2010 12:34:39 PM
If the attribute is present but its value is the empty string then I think with version="2.0" there should indeed an error be raised, with version="1.0" and an XSLT 2.0 processor implementing backwards compatibility mode then result should be "NaN". However Altova still raises an error. Saxon 9 does not.
You might want to code
Code:
format-number(if (@bar castable as xs:double) then @bar else number(''), '$#,##0.00')

I think that gives the behaviour you want with an XSLT 2.0 processor, independent of the XSLT version attribute in the stylesheet.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.