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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:34:49+00:00 2026-06-02T19:34:49+00:00

i want to transform a xml with the XSLTProcessor. Everthing is working fine but

  • 0

i want to transform a xml with the XSLTProcessor. Everthing is working fine but i got problems with the attribute-sets.

My XML looks like:

<?xml version="1.0" encoding="UTF-8"?>
<exportDelivery>
<job>/* many other tags and data */</job>
<job>/* many other tags and data */</job>
<job>/* many other tags and data */</job>
</exportDelivery>

If you want to use attributes in your new xml you have to use attribue-sets in the xsl-file. But attribute-sets have to be defined in the “head” of the xsl. that means outside of the foreach-loop for the “job”-tags.
After the Transformation every job gets the same attributes of the first job. What did i wrong? Here is a attribue-set i use:

  <xsl:attribute-set name="premium">
    <xsl:attribute name="from">
      <xsl:value-of select="/exportDelivery/jobAdvertisements/startDate"/>
    </xsl:attribute>
    <xsl:attribute name="to">
      <xsl:value-of select="/exportDelivery/jobAdvertisements/endDate"/>
    </xsl:attribute>
  </xsl:attribute-set>

Thanks!

  • 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-02T19:34:50+00:00Added an answer on June 2, 2026 at 7:34 pm

    attribute-sets are used as a shorthand for providing multiple attributes at once, so instead of writing:

    <xsl:attribute name="border">5</xsl:attribute>
    <xsl:attribute name="cellpadding">15</xsl:attribute>
    <xsl:attribute name="cellspacing">10</xsl:attribute>
    

    every time we want to specify all three at once, one may specify an attribute-set to do it in one line

    <xsl:attribute-set name="set_table">...</xsl:attribute-set>
    
    <table xsl:use-attribute-sets="set_table">
    

    These “attribute-sets” can only be defined once.
    in your case, don’t you want to do something like this?

    <job>
      <premium from="blaDate" to="fooDate"/>
    </job>
    

    if so, i don’t see, what’s stopping you from inserting these elements during the transformation:

    <xsl:template match="job">
      <job>
        <xsl:attribute name="from">
          <xsl:value-of select="/exportDelivery/jobAdvertisements/startDate"/>
        </xsl:attribute>
      </job>
    </xsl:template>
    

    maybe you need to explain a little further, what you are trying to achieve exactly

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

Sidebar

Related Questions

I want to transform an XML document. The source XML looks like this: <svc:ElementList>
I'm using XSLT 1.0 an want to transform an XML file. It works fine
I want to transform an XML file with javax.xml.transform.Transformer , but my web access
I want to do something like this Can you transform unordered xml to match
I want to know whether it is possible to transform Relax NG XML with
I want to read an xml file, apply a transform, then write to another
i want to transform some xml into HTML that has the following format: <TR><TD>
I want to transform (with jquery.xslt.js) xml to be preserving tags in text nodes.
I have a xml document on the following format and want to transform it
my xml document looks somewhat like that (Values are both xsl:hexBinary ): <Offsets> <Offset>

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.