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
|