Transforming XML with XSL to get HTML

Hi experts,

I’m using XSL templates to transform an XML file to get an HTML.

I have some issues using the same name for different nodes (server side)

EG. “last-name”

XML File

<?xml version="1.0" encoding="UTF-8"?>


<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:output method="html"/>
<xsl:template match="/">
<html xmlns="">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>

<xsl:for-each select="//path1">
<input type="text" size="25" name="last-name" id="last-name" value="{last-name}" maxlength="{last-name/@length}" />


<xsl:for-each select="//path2">
<input type="text" size="25" name="last-name" id="last-name" value="{last-name}" maxlength="{last-name/@length}" />


Should I  change the path of the templates?
which is the appropriate way to name the input fields?

Thanks for your help!

Who is Participating?
Wasim Akram ShaikConnect With a Mentor Commented:
I think Using namespaces for the elements would help..

they  would help the processor in distinguishing them

check this link on how to use namespace
mccarlIT Business Systems Analyst / Software DeveloperCommented:
The question is not really very clear, at least to me :)

Can you explain a bit further on exactly what you are asking us to help you with. Also, it isn't clear on what the logical data model is that you are representing with that XML, ie. what do path1 and path2 relate to?

Providing the code and the input XML is good, but can you provide some more words explaining in detail what you are trying to do, the issues that you are facing, etc?
alcaniAuthor Commented:
Ok, I’m sorry. I’ll try to explain it.

In fact we are processing xml files using xsl stylesheets and output is an html form.

Server side is a product called xcentrisity

Attached XSL and XML files

The problem is that server side is not identifying the node because I have many nodes with the same name

Eg. “apellido-paterno”

I think I have to express the attribute “name” from the input field using an xpath expression or some thing like that.

I hope this will help.

I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
Wasim Akram ShaikCommented:
Using namespaces for elements would help in resolving the issue what author has pointed out, so please treat comment http:#a40001014 as an answer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.