Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 21st, 2004, 05:21 AM
Authorized User
 
Join Date: Nov 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default different values with the same attribute name

Hi All,
i have an XML file like this. i have to convert it to another XML file, so that all the data i have to put it in some attributes.
here the problem is, there are 2 constants elements.
if it is one then i can convert it to attributes, now i have 2 elements, so i can not use the same attribute name for 2 different values. how to solve this problem?
<IO_Row>
    <PinNo>
        <Pin>A21</Pin>
    </PinNo>
    <Name PadName = "No" Id = "i51805"><cross-ref
        comment = "71825: TableCell: Signal_ Short_ Name" type = "Cross-Ref"/>Signal_ Short_ Name
    </Name>
    <PinType>I</PinType>
    <BufType>PD</BufType>
    <Function>
        <LongName>Signal Long Name</LongName>
        <DescriptionText>Functional description (optional)</DescriptionText>
        <ResetDescription>Optional functional description</ResetDescription>
        <Strapping>Optional strapping functionality</Strapping>
        <BufferChar>Optional electrical characteristics of the Buffer</BufferChar>
        <Comments><Comment>Pin-related note (opt.)</Comment></Comments>
        <Constant Indent = "Normal">
            <ConstantValue><Bin>0</Bin></ConstantValue>
            <ConstantShortName>SF_0</ConstantShortName><ConstantDescription>Function
                at 0</ConstantDescription>
            <Comment><Emphasis>SF_0</Emphasis>Â =Â obligatory Constant Short Name</Comment>
        </Constant>
        <Constant Indent = "Normal">
            <ConstantValue><Bin>1</Bin></ConstantValue>
            <ConstantShortName>SF_1</ConstantShortName><ConstantDescription>Function
            at 1</ConstantDescription>
            <Comment>On selection (opt.)</Comment>
        </Constant>
    </Function>
</IO_Row>

i have to convert it as:

<ss:Data ss:Type="String" long="Signal Long Name" resetdescription="Optional functional description" buffer="Optional electrical characteristics of the Buffer" strap="Optional strapping functionality" comments="Pin-related note (opt.)" comments_title_id="" comments_title="" comments_title_bin="" comments_title_dec="" comments_title_hex="" comments_title_neg="" comments_title_phy="" comments_title_sub="" comments_title_sup="" comments_title_syb="" comments_title_und="" comments_title_usr="" comments_title_zd="" comments_comment_condition="" comments_comment="Pin-related note (opt.)" comments_comment_bin="" comments_comment_dec="" comments_comment_hex="" comments_comment_neg="" comments_comment_phy="" comments_comment_sub="" comments_comment_sup="" comments_comment_syb="" comments_comment_usr="" comments_comment_zd="" constants_id="" constants_indent="Normal" constants="0#10;SF_0Function#10;at 0#10;SF_0Â =Â obligatory Constant Short Name" constants_constvalue_bin="0" constants_constvalue_dec="" constants_constvalue_hex="" constants_constshort_id="" constants_constshort="SF_0" constants_constdesc="Function#10;at 0" const_constdesc_foot="" const_constdesc_foot_bin="" const_constdesc_foot_dec="" const_constdesc_foot_hex="" const_constdesc_foot_neg="" const_constdesc_foot_phy="" const_constdesc_foot_sub="" const_constdesc_foot_sup="" const_constdesc_foot_syb="" const_constdesc_foot_und="" const_constdesc_foot_usr="" const_constdesc_foot_zd="" description="Functional description (optional) " desctext_neg="" desctext_phy="" desctext_sub="" desctext_sup="" desctext_syb="" desctext_usr="" desctext_zd="">Signal Long NameOptional functional descriptionOptional electrical characteristics of the BufferOptional strapping functionalityPin-related note (opt.)0
SF_0Function
at 0
SF_0Â =Â obligatory Constant Short NameFunctional description (optional) </ss:Data>

Here all elements are having sublements, so i have taken somany attributes.

please give me a suggestion.
thanks,
srini.


srini
__________________
srini





Similar Threads
Thread Thread Starter Forum Replies Last Post
getting distinct values from attribute markus2000 XSLT 1 June 13th, 2006 03:06 AM
DOM Attribute name/values BrendonMelville XML 2 February 15th, 2006 06:05 PM
Access to attribute values from class of attribute jacob C# 1 October 28th, 2005 01:11 PM
how to get values depending on the attribute vidhya XSLT 1 July 8th, 2005 03:55 AM
Matching of attribute values gb XSLT 2 February 10th, 2004 04:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.