Class ProcessorXMLUtil
- java.lang.Object
-
- io.vertigo.quarto.impl.publisher.merger.processor.ProcessorXMLUtil
-
public final class ProcessorXMLUtil extends Object
Classe utilitaire pour une arborescence XML.- Author:
- npiedeloup
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Deque<TagXML>
extractUnbalancedTag(char[] content)
Recupere la pile des tags qui ne sont pas ouvert et ceux qui ne sont pas fermés correctement dans le XML passé en parametre.static Queue<TagXML>
extractUnrepeatableTag(char[] content)
Retourne les tags qui posent problème si l'on cherche à supprimer ou répéter ce bloc XML.static int
getFirstBodyIndex(String content)
static int
getLastBodyEndIndex(String content)
static StringBuilder
parseXMLContent(String xmlContent, String tag, ParserXMLHandler handler)
Parse the XML content and call XML handler when input tag is found.
-
-
-
Method Detail
-
extractUnbalancedTag
public static Deque<TagXML> extractUnbalancedTag(char[] content)
Recupere la pile des tags qui ne sont pas ouvert et ceux qui ne sont pas fermés correctement dans le XML passé en parametre.- Parameters:
content
- Extrait d'un XML correct.- Returns:
- Pile des tags mal ouverts ou mal fermés
-
extractUnrepeatableTag
public static Queue<TagXML> extractUnrepeatableTag(char[] content)
Retourne les tags qui posent problème si l'on cherche à supprimer ou répéter ce bloc XML. Ils s'agit donc des tags qui ne sont pas correctement fermés ou correctement ouverts, sauf si ils sont sans effets sur l'arbre XML. Un tag qui est fermé puis ouvert au même niveau dans l'arbre XML, peut etre supprimé ou multiplié sans compromettre l'intégrité XML.- Parameters:
content
- extrait de XML- Returns:
- Pile des tagXML perturbant la repetition de l'extrait XML
-
getFirstBodyIndex
public static int getFirstBodyIndex(String content)
- Parameters:
content
- contenu XML- Returns:
- la position du premier body de tag trouvé dans le XML passé en paramètre
-
getLastBodyEndIndex
public static int getLastBodyEndIndex(String content)
- Parameters:
content
- contenu XML- Returns:
- la position de fin du dernier body de tag trouvé dans le XML passé en paramètre
-
parseXMLContent
public static StringBuilder parseXMLContent(String xmlContent, String tag, ParserXMLHandler handler)
Parse the XML content and call XML handler when input tag is found.- Parameters:
xmlContent
- Input XML contenttag
- Trigger taghandler
- XML handler of this tag- Returns:
- result content
-
-