简体   繁体   中英

XSLT 2.0 Getting attribute by String

Hello i want to parameterize the Attributes in an external XML File. My first Approach is to get read the attributes from a string but i can't read the Attribute value from the string which contanins the Name of the Attribute... Is there any Solution ???

Example:

Data.xml:

<data attrib1="firstattrb1" attrib2="secondattrb1"/> <data attrib1="firstattrb2" attrib2="secondattrb2"/>


Configure.xml:

<ReadAttrib>attrib1</ReadAttrib>

I want to read only the Attribute that i can write in the configure.xml

如果您定义键<xsl:key name="att-by-name" match="data/@*" use="local-name()"/> ,则可以使用key('att-by-name', document('Configure.xml')//ReadAttrib)来查找ReadAttrib元素中给定名称的属性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM