Ejemplo n.º 1
0
static void
findRelaxNGTags (void)
{
	int corkIndex = CORK_NIL;

	findXMLTags (NULL, NULL,
		     relaxngXpathTableTable + TABLE_MAIN,
		     RelaxNGKinds,
		     &corkIndex);
}
Ejemplo n.º 2
0
static void
findXsltTags (void)
{
	int scopeIndex = CORK_NIL;

	findXMLTags (NULL, NULL,
		     xsltXpathTableTable + TABLE_MAIN,
		     XsltKinds,
		     &scopeIndex);
}
Ejemplo n.º 3
0
static void
relaxngFindTags (xmlNode *node,
		 const struct sTagXpathRecurSpec *spec,
		 xmlXPathContext *ctx,
		 void *userData)
{
	int corkIndex = *(int *)userData;

	findXMLTags (ctx, node,
		     relaxngXpathTableTable + spec->nextTable,
		     RelaxNGKinds,
		     &corkIndex);
}
Ejemplo n.º 4
0
static void makeTagRecursively (xmlNode *node,
				const tagXpathRecurSpec *spec,
				xmlXPathContext *ctx,
				void *userData)
{
	int backup = *(int *)userData;

	findXMLTags (ctx, node,
		     xsltXpathTableTable + spec->nextTable,
		     XsltKinds,
		     userData);

	*(int *)userData = backup;
}
Ejemplo n.º 5
0
static void makeTagRecursivelyWithVersionVerification (xmlNode *node,
						       const tagXpathRecurSpec *spec,
						       xmlXPathContext *ctx,
						       void *userData)
{
	boolean acceptable = FALSE;
	int backup;

	findXMLTags (ctx, node,
		     xsltXpathTableTable + TABLE_VERSION_VERIFY,
		     NULL,
		     &acceptable);
	if (!acceptable)
		return;

	backup = *(int *)userData;
	findXMLTags (ctx, node,
		     xsltXpathTableTable + TABLE_STYLESHEET,
		     XsltKinds,
		     userData);

	*(int *)userData = backup;
}
Ejemplo n.º 6
0
static void plistFindTagsUnderKey (xmlNode *node,
				   const struct sTagXpathRecurSpec *spec,
				   xmlXPathContext *ctx,
				   void *userData)
{
	xmlNode *current;
	xmlNode *prev;
	stringList *queue;
	vString* path;
	vString* v;
	int c;

	queue = stringListNew ();
	current = node;
	for (current = node; current; current = current->parent)
	{
		if (isCompoundElement (current)
		    && (prev = getPrevKeyElement (current)))
		{
			char* parent = (char *)xmlNodeGetContent (prev);
			if (parent)
			{
				v = vStringNewInit (parent);
				stringListAdd (queue, v);
				xmlFree (parent);
			}
		}
	}

	path = vStringNew ();
	while ((c = stringListCount (queue)) > 0)
	{
		v = stringListLast (queue);
		vStringCat (path, v);
		vStringDelete (v);
		stringListRemoveLast (queue);
		if (c != 1)
			vStringPut (path, '.');
	}
	stringListDelete (queue);

	findXMLTags (ctx, node,
		     plistXpathTableTable + TABLE_TEXT,
		     PlistKinds,
		     (vStringLength (path) > 0)? vStringValue (path): NULL);

	vStringDelete (path);
}
Ejemplo n.º 7
0
static void
findPlistTags (void)
{
	findXMLTags (NULL, NULL, plistXpathTableTable + TABLE_MAIN, PlistKinds, NULL);
}