jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Wechner <michael.wech...@wyona.com>
Subject Re: namespaces
Date Wed, 16 Mar 2005 21:56:49 GMT
Peeter Piegaze wrote:

>On Wed, 16 Mar 2005 16:31:44 +0100, Andreas Hartmann
><andreas.hartmann@wyona.org> wrote:
>  
>
>>Tobias Strasser wrote:
>>    
>>
>>>well: "/*[local-name()='hugo' and
>>>namespace-uri()='http://foo.bar.org']" is not a valid path :-)
>>>      
>>>
>>What's wrong with it?
>>
>>LocationPath -> AbsoluteLocationPath
>>AbsoluteLocationPath -> '/' RelativeLocationPath
>>RelativeLocationPath -> Step
>>Step -> AbbreviatedAxisSpecifier NodeTest '[' PredicateExpr ']'
>>NodeTest -> NameTest ("*")
>>PredicateExpr -> Expr
>>Expr -> AndExpr
>>AndExpr -> EqualityExpr 'and' EqualityExpr
>>EqualityExpr (1) -> PrimaryExpr (1) '=' Literal
>>EqualityExpr (2) -> PrimaryExpr (2) '=' Literal
>>PrimaryExpr (1) -> FunctionCall
>>PrimaryExpr (2) -> FunctionCall
>>
>>It's not about the quotation marks, is it? :)
>>    
>>
>
>The first parameter of Session.exportDocView is not an XPath. It is a
>JCR path. A JCR path is similar to a file system path (e.g.,
>"/a/b/c"). It points to a single item in a JCR workspace tree. The
>concept of the JCR path is foundational to the design of the system
>(see section 4.6 of the spec) and is used in many many methods. 
>

got that, but let me do a concrete example:


1) I create a node "/authoring"

2) I import an XML with the following namespaces:

<?xml version="1.0" encoding="UTF-8"?>
<site i18n:attr="label" label="Authoring"
    xmlns="http://apache.org/cocoon/lenya/sitetree/1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation=
        "http://apache.org/cocoon/lenya/sitetree/1.0
        ../../../../resources/entities/sitetree.xsd"
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
 >....

and attach it to the node "/authoring"


3) After the import I take a look at the repository with the dump method
of the FirstSteps example and see


Node: /authoring/_pre10:site
Property: /authoring/_pre10:site/jcr:primaryType = nt:unstructured
Property: /authoring/_pre10:site/i18n:attr = label
Property: /authoring/_pre10:site/label = Authoring
Property: /authoring/_pre10:site/xsi:schemaLocation = 
http://apache.org/cocoon/lenya/sitetree/1.0         
../../../../resources/entities/sitetree.xsd


which means Jackrabbit "renamed" the prefix of the default namespace

http://apache.org/cocoon/lenya/sitetree/1.0

to "_pre10" for its "internal" representation


4) I want to retrieve the node

"/authoring/_pre10:site"

which works of course ;-) but I don't want to hardcode the prefix 
"_pre10" of course
because it could be anything, only the namespace should matter. That's 
why I thought
one has to do it as with XPath.

Makes sense? Just wanted to explain how I got to this thinking.

>XPath
>is used in a JCR repository only in the context of search.
>  
>

ok, I could do this, but I guess the performance wouldn't be that good.

Let me take now a look at Jukka's DocumentViewExportVisitor.java ;-)

Thanks

Michi

>Cheers,
>Peeter
>
>  
>


-- 
Michael Wechner
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


Mime
View raw message