Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix markdown syntax and xml-to-json intro
  • Loading branch information
line-o committed Jun 18, 2021
commit 1c0001d96bc743aa88828cf96e90e85e5c9ee54a
9 changes: 6 additions & 3 deletions src/main/xar-resources/data/docs/fn/xml-to-json.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# fn:xml-to-json() ([specification](https://www.w3.org/TR/xpath-functions-31/#func-xml-to-json"))
handles most valid input according to specification. Notable exceptions follow.
The implementation of `fn:xml-to-json()` handles most valid input according to the ([specification](https://www.w3.org/TR/xpath-functions-31/#func-xml-to-json")). Notable exceptions follow.

All output is generated by the `jackson` library and should be proper JSON. All (un-) escaping is delegated to `com.fasterxml.jackson`.
and should be proper JSON.
Expand All @@ -11,21 +10,25 @@ It does not do additional special character replacements mentioned in the spec.
It does not do an otherwise verbatim copy.

# Examples

## 1)

```xquery
let $node := <string>&#127;</string>
return fn:xml-to-json($node)
```
does return `""` and not `"\u007F"`.

## 2)

```xquery
let $node := <string escaped="true">\/</string>
return fn:xml-to-json($node)
```
does return `"/"` and not `"\/"`.

##3)
## 3)

```xquery
let $node := <string escaped="true">&#127;</string>
return fn:xml-to-json($node)
Expand Down
3 changes: 2 additions & 1 deletion src/main/xar-resources/data/docs/process/execute.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Options for process:execute

The eXistdb process module enables admin users to execute system command on the maschine where eXist is running. The process:execute command receives two parameters, the command to execute and optional a list of options. These options are

* workingDir
Expand All @@ -20,6 +20,7 @@ let $options := \<option>
return
process:execute(("ls","-l"),$options)
```

### Result

Lists the files in the directory '/etc' in long format (-l)
Expand Down
16 changes: 8 additions & 8 deletions src/main/xar-resources/data/docs/xproc/xproc.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#XProc in eXist
# XProc in eXist

_written by Erik Siegel (erik at xatapult.nl) in March 2014_


Expand All @@ -21,6 +22,7 @@ The XProc module will only work on eXist versions > V2.1! That is, as long as th
Fire up the package manager from eXist’s dashboard and install it from the public eXist module repository.

### Deinstall

De-installing the package is not the easy normal package manager’s routine for this. Because the package includes a jar file, it is (partly) locked by eXist and some extra work is required:

1. De-install the package first through the package manager’s normal de-install command. This seems to work, but when you refresh the list the package still seems to be there.
Expand All @@ -32,7 +34,7 @@ De-installing the package is not the easy normal package manager’s routine for

You’ll probably need to use this explicit de-install procedure before you install a new version. Because of the jar file locking, the normal package manager’s effortless update procedure will not work properly.

##Basic usage
## Basic usage

Here is a very simple “Hello World” XProc in eXist:

Expand Down Expand Up @@ -67,6 +69,7 @@ Simply calling *xproc:process* will start Calabash and do the trick. The functio


## xproc:process

The module exposes three xproc:process variants:
* xproc:process( $xproc-document )
* See the “basic usage” section above.
Expand All @@ -85,9 +88,8 @@ xproc:process( $xproc, (
```

### <g options
You can pass values for XProc options to the pipeline using:


You can pass values for XProc options to the pipeline using:

```xml
\<option name="option-name" value="option-value"/>
Expand Down Expand Up @@ -133,17 +135,15 @@ Example:
\<output port="extraresult" url="xmldb:///db/path/to/my/data.xml"/>
```




## Additional features

Relative URL’s inside your XProc script (and inside the XSLT/XQuery scripts used by the pipeline) work as expected: That is: they are resolved against the location of the document they’re in. This is an important feature because it allows you to develop your XProc pipelines outside of eXist and easily integrate them when they’re ready.

Developing XProc pipelines outside of eXist (using an IDE like for instance oXygen) is usually much easier than doing the same thing directly in/on the database.

The XProc *\<p:store>* step works and can write documents to the database. The URL must be an absolute URL pointing to a location in the database. **Watch out:** It must begin with the pre fix *xmldb://* (instead of the usual *xmldb:exist://*).

## Known limitations

* Probably the most important limitation is that the XQuery scripts called/used by the XProc pipelines do *not* run on eXist’s XQuery engine but on Saxon inside Calabash. As a consequence, you cannot easily access the database or use eXist’s extension functions. XPath in structions will not use any indexes and will not be optimized.
* The *<pxp:zip>* instruction does not work properly (but the *<pxp:unzip>* does).