Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9045213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:13:35+00:00 2026-06-16T11:13:35+00:00

I have an XSL program which in turn generates an XSL program, which depending

  • 0

I have an XSL program which in turn generates an XSL program, which depending on the input might look like this:

<xsl:variable name="patterns"/> <!--empty in this particular case-->

<xsl:template name="token">
    <xsl:for-each select="$patterns/pattern">
...

When I then run the generated stylesheet, Saxon, bless its heart, is apparently doing some kind of static analysis and complains:

XPTY0019: Required item type of first operand of '/' is node(); supplied value has item type xs:string

and won’t even compile the stylesheet.

My workaround was to generate a dummy element in the $patterns nodeset, but is there any cleaner approach here, or way to suppress the compile error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:13:36+00:00Added an answer on June 16, 2026 at 11:13 am

    According to http://www.w3.org/TR/xslt20/#variable-values, “If the variable-binding element has empty content and has neither a select attribute nor an as attribute, then the supplied value of the variable is a zero-length string.”.

    So you need to change that, for instance by doing <xsl:variable name="patterns" select="()"/> to bind an empty sequence as the variable value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have XSL code that looks like this... <xsl:template name=doHeader> <meta http-equiv=X-UA-Compatible content=IE=EmulateIE9 />
I have a xsl:variable ($features-list) specified in my XSL which contains a tree fragment
I have 2 xml files. I would like wite xsl program that eliminates (and
I have xml like <programs> <program name=breaking laws id=97;#ttt;#98;#tpl;#41;#fel /> <program name=advanced technology id=89;#hjk;#95;#uio;#81;#lpk
I have an XSL template: <meta name=description content={$page-description}/> and a variable: <xsl:variable name=page-description> <xsl:choose>
I have an xsl:fo style sheet that refers to a URL which is an
I have an XSL style sheet for which I need to add some custom
I have the following xsl with me <Root> <child> <Book name=Title value=hailey /> <Book
If have a big 'xsl:choose' chunk in which I need to set a number
I have some XML files of this form: <?xml version=1.0 encoding=utf-8?> <?xml-stylesheet type=text/xsl href=biomirror.xsl?>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.