diff options
author | lordjaxom <lordjaxom> | 2004-12-12 19:53:30 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2004-12-12 19:53:30 +0000 |
commit | 3b0999969632e2820b846ca8adcef6b346ff7441 (patch) | |
tree | 1582ed7db886839ea06c226e228eade0516f60c2 /xml/xml.c | |
parent | e4c359b5c303cecfc49fb82799805da9fee8dadb (diff) | |
download | vdr-plugin-text2skin-3b0999969632e2820b846ca8adcef6b346ff7441.tar.gz vdr-plugin-text2skin-3b0999969632e2820b846ca8adcef6b346ff7441.tar.bz2 |
1.0-pre3v1.0-pre3
Diffstat (limited to 'xml/xml.c')
-rw-r--r-- | xml/xml.c | 32 |
1 files changed, 31 insertions, 1 deletions
@@ -16,6 +16,9 @@ enum { LOOK4START, // looking for first element start LOOK4TAG, // looking for element tag INTAG, // reading tag + INCOMMENT, // reading comment + LOOK4CEND1, // looking for second '-' in --> + LOOK4CEND2, // looking for '>' in --> LOOK4ATTRN, // looking for attr name, > or / INATTRN, // reading attr name LOOK4ATTRV, // looking for attr value @@ -149,7 +152,7 @@ XML::readChar(int c) { } break; } else { - if (c == '?' || c == '!') { + if (c == '?') { skipping = true; break; } @@ -159,6 +162,8 @@ XML::readChar(int c) { state = INTAG; } else if (c == '/') { state = LOOK4CLOSETAG; + } else if (c == '!') { + state = INCOMMENT; } else if (!isspace(c)) { if (parseerrorcb) { parseerrorcb(linenr, "Bogus tag char", c); @@ -183,6 +188,31 @@ XML::readChar(int c) { } break; + // reading comment + case INCOMMENT: + if (c == '-') { + state = LOOK4CEND1; + } + break; + + // looking for second '-' in "-->" + case LOOK4CEND1: + if (c == '-') { + state = LOOK4CEND2; + } else { + state = INCOMMENT; + } + break; + + // looking for '>' in "-->" + case LOOK4CEND2: + if (c == '>') { + state = LOOK4START; + } else if (c != '-') { + state = INCOMMENT; + } + break; + // looking for attr name, > or / case LOOK4ATTRN: if (c == '>') { |