XMLImportParser XMLImportParser(
)
|
|
Constructeur
void init(
string
$class
)
|
|
Initialisation du parser
Initialize the parser, getting all the styles defined in the ME : internal styles and characterstyles (synonym styles and different language styles are detected).
Parameters:
|
string |
$class: |
the name of the class of the object (entity) imported |
void parse(
string
$string, object
&$handler
)
|
|
Analyse du contenu XHTML de l'entité
Parse the XHTML contents of the entity and send the data to the $handler object This function is a hard piece of work. I choose not to go to DOM too avoid using lot of memory and processing to build the tree but I'm not sure to perform much better here.
Parameters:
|
string |
$string: |
the string to parse |
|
object |
&$handler: |
the handler of the parser |
void _init_class(
string
$class, [string
$criteria = '']
)
|
|
Initialise la classe en cherchant à savoir ce qu'il faut faire avec les styles détectés. (suivant les champs définies dans le ME).
Gather information from tablefield to know what to do with the various styles. class is the context and criteria is the where to select the tablefields
Parameters:
|
string |
$class: |
the name of the class to init |
|
string |
$criteria: |
the possible SQL criterions (by default empty) |
void _objectize(
array
&$arr, boolean
$blockstyle
)
|
|
Remplace un style par un objet quand c'est possible
Replace style by object whenever it is possible
Parameters:
|
array |
&$arr: |
an array containing all the elements of a doc |
|
boolean |
$blockstyle: |
true if the style is a block style and false if not |
void _parseOneStep(
array
&$arr, integer
$i, array
&$datastack, array
&$classstack, string
$level
)
|
|
Première étape du parser
do one step of the parser. 1/ call the handler corresponding to the current style/tag/object 2/ change the context if required 3/ feed the datastack
Parameters:
|
array |
&$arr: |
?? |
|
integer |
$i: |
?? |
|
array |
&$datastack: |
pile des données |
|
array |
&$classstack: |
pile des classes utilisées |
|
string |
$level: |
can be inline or ? |
API Tags:
void _prepare_style(
string
&$style,
&$obj, object
&$object
)
|
|
Prépare un style pour stocakge en détectant les synonymes et les langues d'un style Prepare the style for storage detecting synonyms and same language style
Parameters:
|
string |
&$style: |
the name of the style |
|
object |
&$object: |
the VO corresponding to the style |
|
|
&$obj: |
|