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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:43:28+00:00 2026-05-15T04:43:28+00:00

I am quite weak at XSLT so this might seem obvious. Here is some

  • 0

I am quite weak at XSLT so this might seem obvious. Here is some sample XML

 <term>
  <name>cholecystocolonic fistula</name> 
  <definition>blah blah</definition> 
  <reference>cholecystocolostomy</reference> 
  </term>

And here is the XSLT I wrote a while ago to process it

<xsl:template name="term">
    {
    "dictitle": "<xsl:value-of select="name" disable-output-escaping="yes" />",
    "html": "<xsl:value-of select="definition" disable-output-escaping="yes"/>",
    "reference": "<xsl:value-of select="reference" disable-output-escaping="yes"/>
}
</xsl:template>

Basically I am creating JSON from the XML.

The requirements have now changed so that now the XML can have more than one definition tag and reference tag. They can appear in any order, i.e definition, reference, reference, definition, reference.

How can I update the XSLT to accommodate this? Probably worth mentioning that because my XSLT processor is using .NET I can only use XSLT 1.0 commands.

Many thanks!

EDIT – Clarification

This is the kind of JSON I would want created, given the following example XML

 <term>
  <name>cholecystocolonic fistula</name> 
  <definition>blah blah</definition> 
  <reference>cholecystocolostomy</reference>
  <definition>XSLT is not as easy as it should be</definition>
  <reference>qui</reference> 
  </term>

{
    dictitle: "cholecystocolonic fistula",
    html: "blah blah",
    reference: "cholecystocolostomy",
    html: "XSLT is not as easy as it should be",
    reference: "qui"
}
  • 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-05-15T04:43:29+00:00Added an answer on May 15, 2026 at 4:43 am

    JSON property names have to be unique, so you can’t have multiple ‘reference’ properties in the way you’ve outlined.

    XML doesn’t have this restriction; you’re allowed to have several ‘reference’ nodes at the same level.

    http://metajack.im/2010/02/01/json-versus-xml-not-as-simple-as-you-think/

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

Sidebar

Related Questions

Please recommend me some books and practices for me. I am quite weak in
Since performance of string concatenation is quite weak in VB6 I'm testing several StringBuilder
Quite some time i`ve learnt MVC. I have seen various techniques to post data
Quite new to maven here so let me explain first what I am trying
quite some time ago i noticed that in Visual C++ 10 ADL fails when
Quite often see in JavaScript libraries code like this: setTimeout(function() { ... }, 0);
Quite stumped on this one. I am using the Youtube JS API to determine
Quite not sure why I see this error. I navigate to my Login View
Quite recently, I asked a question about debugging a seg fault: What are some
I'll start by saying that my database skills are weak, and it's quite possible

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.