开发者

xmlNodeGetContent introduces newlines

It seems xmlNodeGetContent introduces newlines, where there shouldn't be.

This a node dump:

ELEMENT td
  ATTRIBUTE width
    TEXT
      content=100%
  ATTRIBUTE bgcolor
    TEXT
      content=#FFFFFF
  ELEMENT font
    ATTRIBUTE face
      TEXT
        content=Arial,Helvetica
    ELEMENT font
      ATTRIBUTE color
        TEXT
          content=#0000FF
      ELEMENT font
        ATTRIBUTE size
          TEXT
            content=-1
        ELEMENT b
          ELEMENT br
  TEXT
    content= 
  ELEMENT hr
  ELEMENT font
    ATTRIBUTE face
      TEXT
        content=Arial,Helvetica
    ELEMENT font
      ATTRIBUTE color
        TEXT
          content=#0000FF
      ELEMENT font
        ATTRIBUTE size
          TEXT
            content=-1
        ELEMENT b
          TEXT
            content=love
        ELEMENT br
  TEXT
    content= 
  ELEMENT ul
    ELEMENT li
      ELEMENT small
        ELEMENT font
          ATTRIBUTE color
            TEXT
              content=#FF0000
          TEXT
            content=s
        TEXT
          content= iubire 
        ELEMENT font
          ATTRIBUTE color
            TEXT
              content=#FF0000
          TEXT
            content=f
        TEXT
          content=; dragoste 
        ELEMENT font
          ATTRIBUTE color
            TEXT
              content=#FF0000
          TEXT
            content=f
        TEXT
          content=; scump 
        ELEMENT font
          ATTRIBUTE color
            TEXT
              content=#FF0000
      开发者_如何转开发    TEXT
            content=m
        TEXT
          content=; 
        ELEMENT font
          ATTRIBUTE color
            TEXT
              content=#0000FF
          TEXT
            content=to be in love with
        TEXT
          content= a fi #C3#AEndr#C4#83gostit de; 
        ELEMENT font
          ATTRIBUTE color
            TEXT
              content=#0000FF
          TEXT
            content=to send one's love
        TEXT
          content= a transmite complimente; 
        ELEMENT font
          ATTRIBUTE color
            TEXT
              content=#0000FF
          TEXT
            content=love affair
        TEXT
          content= amor; 
        ELEMENT font
          ATTRIBUTE color
            TEXT
              content=#0000FF
          TEXT
            content=lovelorn
        TEXT
          content= dezn#C4#83d#C4#83jduit
    TEXT
      content= 
    ELEMENT li
      ELEMENT small
        ELEMENT font
          ATTRIBUTE color
            TEXT
              content=#FF0000
          TEXT
            content=vt
        TEXT
          content= a iubi; a-i pl#C4#83cea
    TEXT
      content=

And this is the text as returned by xmlNodeGetContent:

  s iubire f; dragoste f; scump
  m; to be in love
  with a fi îndrăgostit de; to send
  one's love a transmite complimente; love affair amor; lovelorn deznădăjduit
  vt a iubi; a-i
  plăcea

As you can see there are line breaks where there shouldn't be.


Despite the unhelpful comments (really, is not obvious what the question was?), I would like to share my explanation.

The extra lines where due to HTML Tidy prettifying the document.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜