이 페이지에서

QXmlParseException Class

QXmlParseException 클래스는 QXmlErrorHandler 인터페이스와 관련된 오류를 보고하는 데 사용됩니다. 더 보기...

헤더: #include <QXmlParseException>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core5Compat)
target_link_libraries(mytarget PRIVATE Qt6::Core5Compat)
qmake: QT += core5compat

참고: 이 클래스의 모든 함수는 재진입 가능합니다.

공개 함수

QXmlParseException(const QString &name = QString(), int c = -1, int l = -1, const QString &p = QString(), const QString &s = QString())
QXmlParseException(const QXmlParseException &other)
~QXmlParseException()
int columnNumber() const
int lineNumber() const
QString message() const
QString publicId() const
QString systemId() const

상세 설명

XML 하위 시스템은 오류를 감지하면 이 클래스의 인스턴스를 생성합니다. systemId(), publicId(), lineNumber() 및 columnNumber() 메서드를 사용하여 오류 발생 위치를 확인하거나, message() 메서드를 통해 오류 정보를 확인할 수 있습니다. 발생할 수 있는 오류 메시지는 다음과 같습니다:

  • "오류가 발생하지 않았습니다"
  • "소비자에 의해 오류 발생"
  • "예기치 않은 파일 끝"
  • "문서 유형 정의가 두 개 이상입니다"
  • "요소 구문 분석 중 오류 발생"
  • "태그 불일치"
  • "콘텐츠 구문 분석 중 오류 발생"
  • "예상치 못한 문자"
  • "처리 지시문의 이름이 유효하지 않습니다"
  • "XML 선언을 읽는 중 예상된 버전이 아닙니다"
  • "독립 선언의 값이 잘못되었습니다"
  • "XML 선언을 읽는 동안 인코딩 선언 또는 독립형 선언이 필요합니다"
  • "XML 선언을 읽는 중에 독립형 선언이 예상됨"
  • "문서 유형 정의(DTD) 구문 분석 중 오류가 발생했습니다"
  • "문자가 예상됨"
  • "주석을 파싱하는 동안 오류가 발생했습니다"
  • "참조를 구문 분석하는 동안 오류가 발생했습니다"
  • "DTD에서 내부 일반 엔티티 참조가 허용되지 않습니다"
  • "속성 값에서 외부 구문 분석된 일반 엔티티 참조를 사용할 수 없습니다"
  • "DTD에서 외부 구문 분석된 일반 엔티티 참조가 허용되지 않습니다"
  • "문맥에 맞지 않는 구문 분석되지 않은 엔티티 참조 n"
  • "재귀 엔티티"
  • "외부 엔티티의 텍스트 선언에 오류가 있습니다"

이러한 오류 메시지를 애플리케이션 사용자에게 표시하려는 경우, 명시적으로 번역되지 않는 한 영어로 표시된다는 점에 유의하십시오.

QXmlErrorHandler 및 QXmlReader도 참조하십시오 .

멤버 함수 문서

[explicit] QXmlParseException::QXmlParseException(const QString &name = QString(), int c = -1, int l = -1, const QString &p = QString(), const QString &s = QString())

공용 식별자 ` p ` 및 시스템 식별자 ` s`에 대해, 열 ` c `의 ` l ` 행에서 발생한 오류 문자열 ` name `을 포함하는 구문 분석 예외를 생성합니다.

QXmlParseException::QXmlParseException(const QXmlParseException &other)

other 의 복사본을 생성합니다.

[noexcept] QXmlParseException::~QXmlParseException()

QXmlParseException 을 파괴합니다.

int QXmlParseException::columnNumber() const

오류가 발생한 열 번호를 반환합니다.

int QXmlParseException::lineNumber() const

오류가 발생한 줄 번호를 반환합니다.

QString QXmlParseException::message() const

오류 메시지를 반환합니다.

QString QXmlParseException::publicId() const

오류가 발생한 공용 식별자를 반환합니다.

QString QXmlParseException::systemId() const

오류가 발생한 시스템 식별자를 반환합니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.