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

  • Home
  • SEARCH
  • 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 8533235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:54:56+00:00 2026-06-11T09:54:56+00:00

Here is my XML: <?xml version="1.0" encoding="utf-16"?> <ArrayOfSzablonPismNadrzedny xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SzablonPismNadrzedny NazwaObiektu="Przesylka1"> <Obiekt xsi:type="PrzesylkaWplywajaca">

  • 0

Here is my XML:

<?xml version="1.0" encoding="utf-16"?>
<ArrayOfSzablonPismNadrzedny xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SzablonPismNadrzedny NazwaObiektu="Przesylka1">
    <Obiekt xsi:type="PrzesylkaWplywajaca">
      <NrKancelaryjny>PWP.247</NrKancelaryjny>
      <DataWplywu>2012-09-15T00:00:00</DataWplywu>
      <ZnakObcy>sdfsdfsdf</ZnakObcy>
      ....... (ommited)
    </Obiekt>
  </SzablonPismNadrzedny>
  <SzablonPismNadrzedny NazwaObiektu="Sprawa1">
    <Obiekt xsi:type="Sprawa">
      <ZnakSprawyOpisowy>USC.5351.135.2012</ZnakSprawyOpisowy>
      <FunkcjaPrzypisana>FE_SPRA</FunkcjaPrzypisana>
      <KontekstProcesowy>EZD</KontekstProcesowy>
     .... (ommited)
    </Obiekt>
  </SzablonPismNadrzedny>

…. (ommited)

Here is my current XSLT:

<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="xml" version="1.0" encoding="UTF-8"/>
<xsl:template match="SzablonPismNadrzedny[@NazwaObiektu='Sprawa1']">
<xsl:apply-templates select="Obiekt/ZnakSprawyOpisowy"/><xsl:text>&#32;</xsl:text>. Skreślono tekst drukowany rubryk I, II, III, IV, V.
</xsl:template>

<xsl:template match="SzablonPismNadrzedny[@NazwaObiektu='Przesylka1']">
Akt sporządzono na podstawie pisma
<xsl:apply-templates select="Obiekt/ZnakObcy"/><xsl:text>&#32;</xsl:text> z dnia 
<xsl:apply-templates select="Obiekt/DataWplywu"/>
<xsl:text>&#32;</xsl:text>. nr
</xsl:template>

</xsl:stylesheet>

Problem is that my output looks like: Akt sporządzono na podstawie pisma value1 z dnia value2. nr value3 Skreślono tekst drukowany rubryk I, II, III, IV, V.

Instead of: value3 Skreślono tekst drukowany rubryk I, II, III, IV, V.
Akt sporządzono na podstawie pisma value1 z dnia value2. nr

It takes the order from XML as far as I know. Tried to user priority attribute on xsl:template without results. Anyone knows how can this piece of code be improved?

  • 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-11T09:54:57+00:00Added an answer on June 11, 2026 at 9:54 am

    your XSLT finds <SzablonPismNadrzedny NazwaObiektu="Przesylka1"> first in your input XML that is why it is in the output first.

    If you add another template with apply-templates in the correct order I think you get the output you want. Use this XSLT:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
    
    <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
    
    <xsl:template match="/">
        <xsl:apply-templates select="//SzablonPismNadrzedny[@NazwaObiektu='Sprawa1']"/>
        <xsl:apply-templates select="//SzablonPismNadrzedny[@NazwaObiektu='Przesylka1']"/>
    </xsl:template>
    
    <xsl:template match="SzablonPismNadrzedny[@NazwaObiektu='Sprawa1']">
        <xsl:apply-templates select="Obiekt/ZnakSprawyOpisowy"/><xsl:text>&#32;</xsl:text>. Skreślono tekst drukowany rubryk I, II, III, IV, V.
    </xsl:template>
    
    <xsl:template match="SzablonPismNadrzedny[@NazwaObiektu='Przesylka1']">
        Akt sporządzono na podstawie pisma
        <xsl:apply-templates select="Obiekt/ZnakObcy"/><xsl:text>&#32;</xsl:text> z dnia 
        <xsl:apply-templates select="Obiekt/DataWplywu"/>
        <xsl:text>&#32;</xsl:text>. nr
    </xsl:template>
    </xsl:stylesheet>
    

    and you get this text output:

    USC.5351.135.2012 . Skreślono tekst drukowany rubryk I, II, III, IV, V.
    
        Akt sporządzono na podstawie pisma
        sdfsdfsdf  z dnia 
        2012-09-15T00:00:00 . nr
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the XML: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <feed xmlns=http://www.w3.org/2005/Atom xmlns:dc=http://purl.org/dc/elements/1.1/> <title>Rated Images</title> <link
Here is the xml file of my Android widget: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
Here is my XML document: <?xml version="1.0" encoding="UTF-8"?> <container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"> <rootfiles> <rootfile full-path="content.opf"
Why does my relative layout occupy full screen width <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
Here is my XML Response: <DIDL-Lite xmlns=urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/ xmlns:dc=http://purl.org/dc/elements/1.1/ xmlns:upnp=urn:schemas-upnp-org:metadata-1-0/upnp/ <item id=1182 parentID=40 restricted=1> <title>Hot
Consider the following XML: <?xml version="1.0" encoding="utf-8"?> <treelist id="foo" displayname="display"> <treelink id="link" /> </treelist>
I'm trying to create a large XML tree in R. Here's a simplified version
With glassfish, my persistence.xml is not loaded. my.ear META-INF/persistence.xml lib/entities.jar <!-- no persistence.xml here
Here is my XML: <section> <para>part1 <breakline/> part2 <list> <para>list1 </para> <para>list2 </para> </list>
here is my xml DOM. <entities> <entity id=7006276> <title>xxx</title> <entities> <entity id=7877579> <title>xxx</title> <entities>

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.