Skip to content
Snippets Groups Projects
Commit 42a005d6 authored by PeiYong Zhang's avatar PeiYong Zhang
Browse files

Compilation error on (AIX, Solaris) solved

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175923 13f79535-47bb-0310-9956-ffa450edef68
parent 5e5be224
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
#include <xercesc/util/BinInputStream.hpp> #include <xercesc/util/BinInputStream.hpp>
#include <xercesc/util/PlatformUtils.hpp> #include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/RuntimeException.hpp> #include <xercesc/util/RuntimeException.hpp>
#include <xercesc/util/TranscodingException.hpp>
#include <xercesc/util/TransService.hpp> #include <xercesc/util/TransService.hpp>
#include <xercesc/util/XMLEBCDICTranscoder.hpp> #include <xercesc/util/XMLEBCDICTranscoder.hpp>
#include <xercesc/util/XMLString.hpp> #include <xercesc/util/XMLString.hpp>
...@@ -1501,101 +1500,4 @@ XMLReader::xcodeMoreChars( XMLCh* const bufToFill ...@@ -1501,101 +1500,4 @@ XMLReader::xcodeMoreChars( XMLCh* const bufToFill
return charsDone; return charsDone;
} }
/***
*
* XML1.1
*
* 2.11 End-of-Line Handling
*
* XML parsed entities are often stored in computer files which, for editing
* convenience, are organized into lines. These lines are typically separated
* by some combination of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).
*
* To simplify the tasks of applications, the XML processor MUST behave as if
* it normalized all line breaks in external parsed entities (including the document
* entity) on input, before parsing, by translating all of the following to a single
* #xA character:
*
* 1. the two-character sequence #xD #xA
* 2. the two-character sequence #xD #x85
* 3. the single character #x85
* 4. the single character #x2028
* 5. any #xD character that is not immediately followed by #xA or #x85.
*
*
***/
inline void XMLReader::handleEOL(XMLCh& curCh, bool inDecl)
{
// 1. the two-character sequence #xD #xA
// 2. the two-character sequence #xD #x85
// 5. any #xD character that is not immediately followed by #xA or #x85.
if (curCh == chCR)
{
fCurCol = 1;
fCurLine++;
//
// If not already internalized, then convert it to an
// LF and eat any following LF.
//
if (fSource == Source_External)
{
if ((fCharIndex < fCharsAvail) || refreshCharBuffer())
{
if ( fCharBuf[fCharIndex] == chLF ||
((fCharBuf[fCharIndex] == chNEL) && fNEL) )
{
fCharIndex++;
}
}
curCh = chLF;
}
}
else if (curCh == chLF)
{
fCurCol = 1;
fCurLine++;
}
// 3. the single character #x85
// 4. the single character #x2028
else if (curCh == chNEL || curCh == chLineSeparator)
{
if (inDecl && fXMLVersion == XMLV1_1)
{
/***
* XML1.1
*
* 2.11 End-of-Line Handling
* ...
* The characters #x85 and #x2028 cannot be reliably recognized and translated
* until an entity's encoding declaration (if present) has been read.
* Therefore, it is a fatal error to use them within the XML declaration or
* text declaration.
*
***/
ThrowXMLwithMemMgr1
(
TranscodingException
, XMLExcepts::Reader_NelLsepinDecl
, fSystemId
, fMemoryManager
);
}
if (fNEL && fSource == Source_External)
{
fCurCol = 1;
fCurLine++;
curCh = chLF;
}
}
else
{
fCurCol++;
}
return;
}
XERCES_CPP_NAMESPACE_END XERCES_CPP_NAMESPACE_END
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
/* /*
* $Log$ * $Log$
* Revision 1.18 2004/06/15 15:51:21 peiyongz
* Compilation error on (AIX, Solaris) solved
*
* Revision 1.17 2004/06/14 15:18:53 peiyongz * Revision 1.17 2004/06/14 15:18:53 peiyongz
* Consolidated End Of Line Handling * Consolidated End Of Line Handling
* *
...@@ -186,6 +189,7 @@ ...@@ -186,6 +189,7 @@
#include <xercesc/util/XMLChar.hpp> #include <xercesc/util/XMLChar.hpp>
#include <xercesc/framework/XMLRecognizer.hpp> #include <xercesc/framework/XMLRecognizer.hpp>
#include <xercesc/framework/XMLBuffer.hpp> #include <xercesc/framework/XMLBuffer.hpp>
#include <xercesc/util/TranscodingException.hpp>
XERCES_CPP_NAMESPACE_BEGIN XERCES_CPP_NAMESPACE_BEGIN
...@@ -875,6 +879,102 @@ inline bool XMLReader::peekNextChar(XMLCh& chGotten) ...@@ -875,6 +879,102 @@ inline bool XMLReader::peekNextChar(XMLCh& chGotten)
return true; return true;
} }
/***
*
* XML1.1
*
* 2.11 End-of-Line Handling
*
* XML parsed entities are often stored in computer files which, for editing
* convenience, are organized into lines. These lines are typically separated
* by some combination of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).
*
* To simplify the tasks of applications, the XML processor MUST behave as if
* it normalized all line breaks in external parsed entities (including the document
* entity) on input, before parsing, by translating all of the following to a single
* #xA character:
*
* 1. the two-character sequence #xD #xA
* 2. the two-character sequence #xD #x85
* 3. the single character #x85
* 4. the single character #x2028
* 5. any #xD character that is not immediately followed by #xA or #x85.
*
*
***/
inline void XMLReader::handleEOL(XMLCh& curCh, bool inDecl)
{
// 1. the two-character sequence #xD #xA
// 2. the two-character sequence #xD #x85
// 5. any #xD character that is not immediately followed by #xA or #x85.
if (curCh == chCR)
{
fCurCol = 1;
fCurLine++;
//
// If not already internalized, then convert it to an
// LF and eat any following LF.
//
if (fSource == Source_External)
{
if ((fCharIndex < fCharsAvail) || refreshCharBuffer())
{
if ( fCharBuf[fCharIndex] == chLF ||
((fCharBuf[fCharIndex] == chNEL) && fNEL) )
{
fCharIndex++;
}
}
curCh = chLF;
}
}
else if (curCh == chLF)
{
fCurCol = 1;
fCurLine++;
}
// 3. the single character #x85
// 4. the single character #x2028
else if (curCh == chNEL || curCh == chLineSeparator)
{
if (inDecl && fXMLVersion == XMLV1_1)
{
/***
* XML1.1
*
* 2.11 End-of-Line Handling
* ...
* The characters #x85 and #x2028 cannot be reliably recognized and translated
* until an entity's encoding declaration (if present) has been read.
* Therefore, it is a fatal error to use them within the XML declaration or
* text declaration.
*
***/
ThrowXMLwithMemMgr1
(
TranscodingException
, XMLExcepts::Reader_NelLsepinDecl
, fSystemId
, fMemoryManager
);
}
if (fNEL && fSource == Source_External)
{
fCurCol = 1;
fCurLine++;
curCh = chLF;
}
}
else
{
fCurCol++;
}
return;
}
XERCES_CPP_NAMESPACE_END XERCES_CPP_NAMESPACE_END
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment