Loading ...
Sorry, an error occurred while loading the content.

Re: XSLT Question

Expand Messages
  • g_li
    Thanks a lot Ken, I know it is difficult to handle this in XSLT. I decided to extract the value out in the Java code and append it as a separate node to the
    Message 1 of 3 , Jan 31, 2005
    View Source
    • 0 Attachment
      Thanks a lot Ken, I know it is difficult to handle this in XSLT. I
      decided to extract the value out in the Java code and append it as a
      separate node to the end of the original XML and process it as a
      separate node. It is really dumb, but I have no other better way to
      handle it. Or I have to hack it like you suggested.

      Thanks,
      --- In XSL-FO@yahoogroups.com, "G. Ken Holman" <gkholman@c...> wrote:
      > At 2005-01-27 01:04 +0000, g_li wrote:
      > >Sorry if this is a little off topic since it is actually a XSLT
      > >question.
      >
      > XSLT and XPath questions would be better posted to the following list:
      >
      > http://www.mulberrytech.com/xsl/xsl-list
      >
      > There are a number of subscribers who would enthusiastically respond to
      > such questions.
      >
      > There is also an *excellent* FAQ at:
      >
      > http://www.dpawson.co.uk
      >
      > >Here I have an element (A) which has another XML element as
      > >its value.
      >
      > Actually, you don't ... you have an element named A comprised of a
      single
      > text node that has lots of angle brackets in it. There is no
      element named
      > C in your XML example.
      >
      > Some of my students come to my class with this misconception as
      well; it is
      > a common problem.
      >
      > >How do I get the Value of C out?
      >
      > With great difficulty ... well, at least with more difficulty than
      if you
      > actually did have an element named "C".
      >
      > ><A ID="External">
      > ><![CDATA[<B ID="Internal"><C>Something</C></B>]]>
      > ></A>
      > >
      > >Your answer would be greatly appreciated. Thanks.
      >
      > In this special case, given your current node is the element A, you
      could
      > use something like:
      >
      > substring-after(substring-before(.,'</C>'),'<C>')
      >
      > ... but that is only because you know the syntax of your start tag
      for "C"
      > and you know there are no embedded "C" elements.
      >
      > You are asking for the manipulation of text inside of XSLT ...
      something
      > that XSLT 1.0 doesn't do very well.
      >
      > I hope this helps.
      >
      > ............................. Ken
      >
      > --
      > World-wide on-site corporate, govt. & user group XML/XSL training.
      > G. Ken Holman mailto:gkholman@C...
      > Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
      > Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
      > Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
      > Legal business disclaimers: http://www.CraneSoftwrights.com/legal
    Your message has been successfully submitted and would be delivered to recipients shortly.