powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Java [игнор отключен] [закрыт для гостей] / Как прикрутить другой парсер к JAXP?
4 сообщений из 4, страница 1 из 1
Как прикрутить другой парсер к JAXP?
    #32858829
wessen
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Устанавливаю свойство для парсера - http://java.sun.com/xml/jaxp/properties/schemaSource, он выкидывает исключение - org.xml.sax.SAXNotRecognizedException, т.е. парсер по умолчанию(Crimson) не поддерживает JAXP1.2 , хочу прикруить к JAXP Xerses 2, только вот не знаю как:(
...
Рейтинг: 0 / 0
Как прикрутить другой парсер к JAXP?
    #32859241
big_mammoth
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
RTFM

public static SAXParserFactory newInstance()
throws FactoryConfigurationError

Obtain a new instance of a SAXParserFactory. This static method creates a new factory instance This method uses the following ordered lookup procedure to determine the SAXParserFactory implementation class to load:

* Use the javax.xml.parsers.SAXParserFactory system property.
* Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
* Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.parsers.SAXParserFactory in jars available to the runtime.

* Platform default SAXParserFactory instance.
...
Рейтинг: 0 / 0
Как прикрутить другой парсер к JAXP?
    #32860551
wessen
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
big_mammothRTFM

public static SAXParserFactory newInstance()
throws FactoryConfigurationError

Obtain a new instance of a SAXParserFactory. This static method creates a new factory instance This method uses the following ordered lookup procedure to determine the SAXParserFactory implementation class to load:

* Use the javax.xml.parsers.SAXParserFactory system property.
* Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
* Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.parsers.SAXParserFactory in jars available to the runtime.

* Platform default SAXParserFactory instance.

Да, оно самое, просто с ходу не додумался, что там в файле jaxp.properties прописывать :)
...
Рейтинг: 0 / 0
Как прикрутить другой парсер к JAXP?
    #32860657
big_mammoth
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Если в лом праить файл свойств можно и так
java.exe.....-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl

Естественно в classpath должен быть прописан пути к библиотекам
...
Рейтинг: 0 / 0
4 сообщений из 4, страница 1 из 1
Форумы / Java [игнор отключен] [закрыт для гостей] / Как прикрутить другой парсер к JAXP?
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]