Hilbert II - Version 0.03.01

org.qedeq.kernel.xml.mapper
Class Context2XPath

java.lang.Object
  extended byorg.qedeq.kernel.xml.mapper.Context2XPath

public final class Context2XPath
extends Object

Map content string to SimpleXPath string. This class makes it possible to transfer an location of an Qedeq object into an XPath like position description for an XML file representation of that object.

This class has maps something like
getChapterList().get(4).getSectionList().get(0).getSubsectionList().get(4).getLatex().get(0)
into
QEDEQ/CHAPTER[5]/SECTION/SUBSECTIONS/*[5]/TEXT/LATEX TODO mime 20070109: use visitor and Qedeq-Object to get XPath; this is necessary because an Atom (if it is the first in an ElementList) is always an attribute tag - therefore the XML element counting doesn't work (you have to subtract one if the first element is an Atom)

Version:
$Revision: 1.16 $

Method Summary
static String getFileName(ModuleContext context)
          Get file path out of context information.
static String getXPath(ModuleContext context)
          Get XPath out of context information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileName

public static final String getFileName(ModuleContext context)
Get file path out of context information.

Parameters:
context - Context information.
Returns:
File path and name.

getXPath

public static final String getXPath(ModuleContext context)
Get XPath out of context information.

Parameters:
context - Context information.
Returns:
XPath.

Hilbert II - Version 0.03.01

©left GNU General Public Licence
All Rights Reserved.