xsl-list
[Top] [All Lists]

Re: [xsl] Using a node-set as a variable

2019-01-17 17:35:30
Rick,
Here is an example of an item in a large dictionary file of strings that are 
used across many documents so it was worth while having this master file:


Terry






On ‎Thursday‎, ‎January‎ ‎17‎, ‎2019‎ ‎06‎:‎13‎:‎24‎ ‎PM‎ ‎EST, Rick Quatro 
rick(_at_)rickquatro(_dot_)com 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote: 





Hi,
 
I am using an XSLT 2 processor and I have a template like this:
 
    <xsl:template name="parts-head">
        <parts-head>
            <head-row>
                <head-cell>Index No.</head-cell>
                <head-cell>Qty</head-cell>
                <head-cell>U/M</head-cell>
                <head-cell>Part No.</head-cell>
                <head-cell>Component Description</head-cell>
                <head-cell>Shop Order Section</head-cell>
            </head-row>
        </parts-head>
    </xsl:template>
 
I need to localize each of the <head-cell> elements. I would like to find a way 
to have the localized elements, or the entire <parts-head> element in an 
external XML file, so I can do the localization there. I do have a language 
parameter that I can use to tell which element I need. But I am not sure what 
the best practice is here.
 
I could have my external XML file like this:
 
    <settings>
        <parts-head language="en">
            <head-row>
                <head-cell>Index No.</head-cell>
                <head-cell>Qty</head-cell>
                <head-cell>U/M</head-cell>
                <head-cell>Part No.</head-cell>
                <head-cell>Component Description</head-cell>
                <head-cell>Shop Order Section</head-cell>
            </head-row>
        </parts-head>
        <parts-head language="es">
            <head-row>
                <head-cell>Span Index No.</head-cell>
                <head-cell>Span Qty</head-cell>
                <head-cell>Span U/M</head-cell>
                <head-cell>Span Part No.</head-cell>
                <head-cell>Span Component Description</head-cell>
                <head-cell>Span Shop Order Section</head-cell>
            </head-row>
        </parts-head>
    <settings>
 
and read this into a global variable. But then how do I insert the desired 
<parts-head> element into my output? Thank you for any suggestions.
 
Rick
 
Rick Quatro
Carmen Publishing Inc.
rick(_at_)frameexpert(_dot_)com
585-729-6746
www.frameexpert.com/store/
 
Save on energy at quatro.mystream.com
 
 


  XSL-List info and archive 
EasyUnsubscribe (by email) 
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>