Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

XSLT Transformation select parent text without child text.

Valorous Hero ,
Feb 07, 2011 Feb 07, 2011

With a fragement of XML something like this:

XmlNamegedcom
XmlNsPrefix
XmlNsURI
XmlText
XmlComment
XmlAttributes
XmlChildren
xml element
XmlNameI001
XmlNsPrefix
XmlNsURI
XmlText
XmlComment
XmlAttributes
XmlChildren
xml element
XmlNameNAME
XmlNsPrefix
XmlNsURI
XmlTextIan Lee /SKINNER/
XmlComment
XmlAttributes
XmlChildren
xml element
XmlNameSOUR
XmlNsPrefix
XmlNsURI
XmlText@S01891@@
XmlComment
XmlAttributes
XmlChildren

How would I select the NAME.XmlText value WITHOUT selecting the NAME.SOUR.XmlText value?

This line in an xslt string produces the output "Ian Lee /SKINNER/@S01891@" Concatenating the NAME.XmlText and NAME.SOUR.XmlText values.

<xsl:value-of select="/gedcom/I001/NAME"/>
TOPICS
Advanced techniques
678
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 07, 2011 Feb 07, 2011

And two minutes after posting, I finally hit on the correct google search phrase.

<xsl:value-of select="/gedcom/I001/NAME/text()"/>

Does what I want.  I kept trying ::text() in various forms.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 07, 2011 Feb 07, 2011
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources