V
V
Voroncheg2019-05-25 06:54:53
PHP
Voroncheg, 2019-05-25 06:54:53

How to remove or ignore invalid xml tag when parsing xml file in PHP?

Hello. A file with data in xml comes to me from 1-s. But there in some places there is only a closing tag. for example

<ЗначениеСвойства>
    <Значение/>
</ЗначениеСвойства>

There's no meaning, but it somehow comes crooked. The parser stops and throws an error. The normal value looks like this.
<ЗначениеСвойства>
    <Значение/>Value<Значение/>
</ЗначениеСвойства>

Please tell me how can I skip or delete places with crooked tags so that the parser does not stop?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anatoly Medvedev, 2019-05-25
@Voroncheg

This is your curve parser, this is a valid xml tag.
https://msiter.ru/tutorials/uchebnik-xml-dlya-nach...

I
invisii, 2019-05-25
@invisii

https://www.php.net/manual/ru/function.preg-match.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question