13.07.2015 Views

WWW/Internet - Portal do Software Público Brasileiro

WWW/Internet - Portal do Software Público Brasileiro

WWW/Internet - Portal do Software Público Brasileiro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IADIS International Conference <strong>WWW</strong>/<strong>Internet</strong> 2010XLPathExpr ::= AbsLocationPath | RelLocationPathAbsLocationPath ::= “/” RelLocationPathRelLocationPath ::= Step | RelLocationPath “/” StepStep ::= LevelSpec AxisSpec ElementSpec Predicate*LevelSpec ::= (“HL” | “LL”) “::”AxisSpec ::= (“arc‐destination” | “arc‐source” | “linked” | “link‐part‐child” | “link‐part‐descendant”) “::”ElementSpec ::= ElementName “(” QName? “)”ElementName ::= “arc” | “element” | “locator” | “remote” | “resource”Predicate::= “[” Operator Spec“]”OperatorSpec ::= AttributeSpec | LinkSpec | TextSpecAttributeSpec ::= “attribute(” QName “)=” ValueLinkSpec ::= “link(” QName “)”TextSpec ::= “text()=” ValueFigure 5. XLPath EBNF.4. XLPATH PROCESSORThis section presents the definitions of an XLPath language processor, whose architecture is based on MVC(Model-View-Controller) pattern. This architecture and the processing algorithm are described follow.4.1 ArchitectureFollowing MVC pattern, the Model layer of XLPath processor is formed by the components: (i) Expression –maintain XLPath query expressions; (ii) Step – sub-divide XLPath expressions in steps to be sequentiallyprocessed; and (iii) Element Store – store the elements resulting from each step processing.The layer View has the components: (i) Console – provides the user with an interface for the entrance ofquery expressions and <strong>do</strong>cuments, as well as with the presentation of the obtained results; and (ii) Formatter– format the results for visualization by the user.The layer Controller is composed by the modules: (i) Executor – generate a representation of the input<strong>do</strong>cuments in the memory, based on DOM (Document Object Model) technology [Hégaret et al., 2005], andconducts it to the processing together with XLPath expression; and (ii) Processor – processes the XLPathexpression steps sequence and stores the result in an Element Store.Figure 6 brings a representation of XLPath processor containing the components described here.4.2 AlgorithmXLPath processing algorithm is based on the functions xlpathExecutor and xlpathProcessor. At first,xlpathExecutor receives as a parameter an XLPath expression and a representation in DOM of an XML<strong>do</strong>cument. From them, it identifies the initial context element and invokes xlpathProcessor, passing as aparameter the context element identified and the query expression. Next, xlpathProcessor interprets each stepof XLPath expression, going through the links network to identify the interest referentiations that involveeach context element. Figure 7 illustrates this algorithm.5. SAMPLES OF XLPATH USEThe query used as an example in Section 2.2, besides other examples, is solved bellow through XLPath:Select all arcs destiny elements whose element d-ba_TotalBankingActivities is the origin./d‐ba_TotalBankingActivities::HL::arc‐source::arc()/HL::arc‐source::element()Select the locator belonging to the link:definitionLink that connects itself to the element d-ba_BankingActivitiesDomain./d‐ba_BankingActivitiesDomain::LL::linked::locator()[link(link:definitionLink)]95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!