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

XSLT Transformation select parent text without child text.

Valorous Hero ,
Feb 07, 2011 Feb 07, 2011

Copy link to clipboard

Copied

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

Views

660

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

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
Documentation