[英]How to query from inside BaseX?
I have imported my Maven config into BaseX
but found no way to query it.我已将我的 Maven 配置导入
BaseX
但找不到查询它的方法。
I want to query for repository of id="thirdparty-releases"我想查询 id="thirdparty-releases" 的存储库
Neither of the following worked:以下均无效:
/settings/profiles/profile/repositories/repository[id="thirdparty-releases"]
db:open("settings","settings.xml")/settings/profiles/profile/repositories/repository[id="thirdparty-releases"]
My config follows:我的配置如下:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:\Users\Dims\Design\!Lib\!m2\repository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
</mirrors>
<profiles>
<profile>
<id>env-dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>thirdparty-releases</id>
<name>JBoss Thirdparty Releases</name>
<url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases</url>
</repository>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
</repository>
</repositories>
</profile>
</profiles>
</settings>
Your data has a different namespace (see xmlns in the <settings />
node).您的数据具有不同的命名空间(请参阅
<settings />
节点中的 xmlns)。 You either have to change the namespace in your query or you could also use the wildcard selector for querying, eg /*:settings/*:profiles/...
您要么必须更改查询中的命名空间,要么您也可以使用通配符选择器进行查询,例如
/*:settings/*:profiles/...
What do you mean by:你是什么意思:
I want to query for repository of id="thirdparty-releases"
我想查询 id="thirdparty-releases" 的存储库
Because that seems more like a maven question to me...?因为这对我来说更像是一个专家问题......?
BaseX itself, as I'm sure you're aware, is a stand-alone database.我相信您知道,BaseX 本身是一个独立的数据库。 If you only need to query existing data there's no need to even use a
JDK
, although, as BaseX
is a Java app, you will need a JVM
-- so maven doesn't really enter the picture.如果您只需要查询现有数据,则甚至不需要使用
JDK
,不过,由于BaseX
是一个 Java 应用程序,您将需要一个JVM
因此 maven 并没有真正参与其中。
It has a GUI and is quite easy to get started with.它有一个 GUI,很容易上手。
If you also want to run commands from a Java program then you can always look at the github examples or reference the Javadoc
on available commands.如果你也想从Java程序运行的命令,那么您可以随时看GitHub的例子或引用
Javadoc
上可用的命令。
Of course, there are many BaseX
questions on stackoverflow, over three hundred currently, and for [basex] [java] I see nearly fifty results.当然,stackoverflow 上
BaseX
问题很多,目前有三百多个,对于 [basex] [java] 我看到近五十个结果。 There's an excellent mailing list where the main developer is quite available and helpful, as well as everyone else on the list.有一个优秀的邮件列表,其中主要开发人员以及列表中的其他人都非常有用且乐于助人。
Admittedly, I don't understand your question.诚然,我不明白你的问题。 Why would you import your maven config into
BaseX
?为什么要将 Maven 配置导入
BaseX
?
If you're just looking to run xpath
or xquery
on a database, my suggestion would be to use the GUI.如果您只是想在数据库上运行
xpath
或xquery
,我的建议是使用 GUI。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.