Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom namespaces #4

Open
Kolophonium0 opened this issue Jan 27, 2022 · 6 comments
Open

Custom namespaces #4

Kolophonium0 opened this issue Jan 27, 2022 · 6 comments
Assignees

Comments

@Kolophonium0
Copy link

Kolophonium0 commented Jan 27, 2022

I get the following error:

<exception> <path>/db/apps/ediarum.web/views/api/object-part.xql</path> <message>err:XPTY0004 'rws:defaultWit' is not a valid attribute name [at line 65, column 32, source: /db/apps/ediarum.web/views/api/object-part.xql] In function: local:milestone-chunk(node(), node()) [65:32:/db/apps/ediarum.web/views/api/object-part.xql] local:milestone-chunk(node(), node()) [67:32:/db/apps/ediarum.web/views/api/object-part.xql] local:milestone-chunk(node(), node()) [133:9:/db/apps/ediarum.web/views/api/object-part.xql] local:get-part(map(*), node(), node()+, xs:string?) [177:8:/db/apps/ediarum.web/views/api/object-part.xql]</message> </exception>

when trying to access a part of an object of a xml doc, which includes a custom namespace. Is it possible to deal with custom namespaces? I tried to add:

<namespace id="rws">...</namespace>

to the appconf.xml but that doesnt seem to do the trick.

@Kolophonium0
Copy link
Author

Its connected to my changes in the Pull request. This doesnt happen when transforming just the Object. Only if i try to transform just a single part.

@MartinFechner MartinFechner self-assigned this Feb 1, 2022
@MartinFechner
Copy link
Contributor

What's the URL you try to open? And how have you defined the parts in the appconf.xml?

@Kolophonium0
Copy link
Author

Kolophonium0 commented Mar 3, 2022

Its connected to #3. I have an API Request like api/<object-name>/<object-id>/<part-id>?view=view-name which is working great if no custom elements or attributes from custom namespaces are involved. These are working fine if transforming a complete object. But if transforming a part these information is not present anymore. I can think of two possible solutions. Writing the part transform in the api in such a way, that the head is still present, or to enable setting namespaces in partdefinitions. If needed i can send my appconf.

@MartinFechner
Copy link
Contributor

By the way: now I understand #3 . Thanks for that.

If the view works fine with the whole document I think it should work with a part too.l How I understand you some information in the part-xml is missing, and this should be fixed. Can you give an example of the part-xml and which information is missing?

Another option is to declare a namespace explicitly like in

let $namespaces :=
for $ns in $object-def/appconf:item/appconf:namespace
let $prefix := $ns/@id/string()
let $namespace-uri := $ns/string()
return util:declare-namespace($prefix, $namespace-uri)

and https://github.com/ediarum/ediarum.WEB/blob/master/APPCONF.md#31-base-information

<namespace id="tei">http://www.tei-c.org/ns/1.0</namespace>

@MartinFechner
Copy link
Contributor

@Kolophonium0 Is there anything left to do or can I close this issue?

@Kolophonium0
Copy link
Author

Im not sure, this problem is connected to the part transformation, because in the part the namespace declarations are not present anymore. If transfomartions of parts are a welcomed feature i think it needs a rewrite to still include the xml header. Im currently moving the part transformations in my projects to object transformations so im currently not well into this. Maybe close it for now and maybe reopen it later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants