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 7894211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:20:12+00:00 2026-06-03T07:20:12+00:00

Is it possible to match ‘Any node not already matched/handled’? Preferably without making my

  • 0

Is it possible to match ‘Any node not already matched/handled’? Preferably without making my style sheet into an enormous for-each/Choose statement, as the current ordering is critical.

The project is still in development and already being used in the live environment, so the code is, simply put, in a state of rapid flux in response to live data we’re getting in. I am generating a PDF document via FO from XML that may have nodes in it that I don’t know about yet, and would like to add a “fail over” instruction to my XSL-FO transform that puts all the unaccounted-for nodes at the beginning of the document in bright red, to speed up discovery.

I can’t just ignore surprise nodes, as the data needs to be handled. The quicker I can find “orphan” data, the quicker I can get it properly handled and out the door.

I have tried playing around with <xsl:template match="*">...</xsl:template> and various priority=”” settings, but of course it applies to every node.

For example, I might have this in one section because these XML blocks are not guarenteed to come in the correct output order. (Code block formatting is not working for me – four space indent results in nothing, sorry 🙁

<xsl:template match="AccountSummary">
    <fo:block margin-left="2" space-before="1" space-after="1" text-align="center">
        <xsl:apply-templates select="Label"/>
    </fo:block>
    <xsl:apply-templates select="AccountInfo"/>
    <xsl:apply-templates select="AccountProfile"/>
    <xsl:apply-templates select="ChangeInValueOfAccounts"/>
    <!-- ... more goes here -->
</xsl:template>

I would like to do something like

<xsl:template match="AccountSummary">
    <fo:block margin-left="2" space-before="1" space-after="1" text-align="center">
        <xsl:apply-templates select="Label"/>
    </fo:block>
    <xsl:apply-templates select="AccountInfo"/>
    <xsl:apply-templates select="AccountProfile"/>
    <xsl:apply-templates select="ChangeInValueOfAccounts"/>
    <!-- ... more goes here -->
    <xsl:for-each select="not otherwise matched">
        <!-- call zomgRED template -->
    </xsl:for-each>
</xsl:template>

Ideally I’d rather the zomgREDs to be at the top, but at the bottom will work too. Or flagged with text markers. Anything to spit out the text in the final document instead of silently eating it.

  • 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-03T07:20:13+00:00Added an answer on June 3, 2026 at 7:20 am

    Here’s how you might be able to get some flavor of what you are looking for. Though no pushing the unprocessed nodes up to the top:

    1) have the identity transformation in your stylesheet:

    <xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>
    

    2) make sure you call <xsl:apply-templates select="*"/> from all other more specific templates to let the parser going

    The idea is that your specific templates handle the intended transformation to XSL-FO while the identity transform just dumps out everything else into the result tree. The recursive calls will ensure you actually touch all nodes (this is the only way to get them “on record”) and the identity transformation will match those you didn’t catch otherwise.

    That #2 advise can actually get in a way of your XSL-FO logic so may not really be feasible, I can’t tell without having an example input and your current XSL-FO transform. Maybe add it to the question?

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

Sidebar

Related Questions

Is it possible to match attributes that do not belong to a subset of
Is it possible to construct a PCRE-style regular expression that will only match each
Is it possible to match all links without href specified via CSS? Example: <a>Invalid
I know that [abc] will match any one character from that set. The matched
Possible Duplicate: Xcode - iPhone - profile doesn’t match any valid certificate-/private-key pair in
Possible Duplicate: RegEx match open tags except XHTML self-contained tags i want to grap
Possible Duplicate: RegEx match open tags except XHTML self-contained tags If I have a
I have the following code which I use to match fancybox possible elements: $('a.grouped_elements').each(function(){
Is it possible to do a case insensitive match in C# using the Regex
Is it possible to extract the n th match in a string of single-quoted

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.