xml 相关问题

可扩展标记语言(XML)是一种灵活的结构化文档格式,用于定义人类和机器可读的编码规则。

如何使提示文本正常并输入文本加粗?

我想将提示文本设置为正常样式并将输入文本设置为粗体,但是当我将输入文本样式更改为粗体时,它会影响提示并且提示也变为粗体。我该如何解决这个问题? 我只想更改输入文本。我...

回答 1 投票 0

如何使用 NodeJS v18 将文件 xml 上传到 SharePoint Online?

我手爱特上传文件。在在线共享点的文件夹中的 web.xml 中,我只有 client_id、client_secret 和我的共享点的 url。不幸的是,我找不到解决方案。

回答 1 投票 0

如何解析其中包含属性的 XML 元素?安卓、科特林

我有来自服务器的 XML 文件。我使用 xmlPullPrser 将其解析为 Kotlin,但它有一个 'id' 属性。我不知道如何获取“id”值。预先感谢您的答复。 这是一个...

回答 2 投票 0

PHP XML 用现有 XML 文件上的文本替换节点值

假设我有一个结构未知的 XML 文件。但我知道在该 xml 结构中的某处,一个节点具有已知值,例如,node->nodeValue="{1}" 中的 {1}。 嗬...

回答 1 投票 0

WiX XML 始终修改我的 .config 中的第一个元素,忽略关键属性

我想了解Wix,但我无法正确修改我的.config 文件。这是一个例子: ...

回答 1 投票 0

同一 div 标签内所有文本的 XPath?

“不 ” “消息” “ 成立” 我想识别div中的所有文本,并且class属性值是动态的,所以c...

回答 1 投票 0

同一 div 标签内所有文本单词的 XPath?

“不 ” “消息” “ 成立” 我想识别 div 中的所有三个单词,并且 class 属性值是动态的...

回答 1 投票 0

任何人都可以帮助我如何为同一 div 标签内的所有文本单词编写 xpath

“不 ” “消息” “ 成立” 我想识别 div 中的所有三个单词,并且 class 属性值是动态的...

回答 1 投票 0

为什么我的odoo xml记录数据没有更新

我继承了一个模块(招聘模块),然后尝试更新xml数据,但我所有的尝试都不起作用。 我尝试更新像 hr_recruitment.group_hr_recruitment_user 这样的组,但更新...

回答 1 投票 0

如何连接Freeplane父节点中所有子节点的匹配属性?

Freeplane 文件是 XML,它们显然使用 groovy 脚本,但我无法弄清楚如何使用父节点中的公式返回属性(作为文本字符串)。主要帮助页面在这里:http...

回答 1 投票 0

如何从 Config.xml 文件更新 Inno Setup AppVersion [Setup] 值

我想在编译时通过解析 Version 标记从 config.xml 文件更新 [Setup] 部分中的 AppVersion 值。 Config.xml 文件具有以下配置: 我想通过解析 AppVersion 标签在编译时从 [Setup] 文件更新 config.xml 部分中的 Version 值。 Config.xml 文件具有以下配置: <?xml version="1.0" encoding="utf-8"?> <Configuration> <Version>1.0.1</Version> </Configuration> 我的应用程序正在使用 config.xml 文件作为应用程序版本。我也想在 Inno Setup 安装程序版本中使用相同的版本。 我是 Inno Setup 脚本开发的新手。如果有人为我提供正确的方法,那将非常有帮助。 您可以使用简单的 PowerShell 代码,例如: $version = ([xml](Get-Content 'config.xml')).Configuration.Version Set-Content -Path 'version.txt' -Value $version 并使用 Inno Setup 预处理器运行它: #define RetrieveVersion(str FileName) \ Local[0] = AddBackslash(GetEnv("TEMP")) + "version.txt", \ Local[1] = \ "-ExecutionPolicy Bypass -Command """ + \ "$version = ([xml](Get-Content '" + FileName + "')).Configuration.Version;" + \ "Set-Content -Path '" + Local[0] + "' -Value $version;" + \ """", \ Exec("powershell.exe", Local[1], SourcePath, , SW_HIDE), \ Local[2] = FileOpen(Local[0]), \ Local[3] = FileRead(Local[2]), \ FileClose(Local[2]), \ DeleteFileNow(Local[0]), \ Local[3] [Setup] AppVersion={#RetrieveVersion("C:\path\config.xml")} 有关类似问题,请参阅从 Inno Setup 中的文本文件读取应用程序版本。 尽管我假设应用程序编译器实际上使用 config.xml 作为应用程序可执行版本。如果是这种情况,您可以更轻松地从 .exe 检索版本。 请参阅如何根据我的应用程序版本自动设置 Inno Setup 安装程序的版本?

回答 1 投票 0

使用 python 解析 XML 抛出异常

完成 XMLReader 类,我们将 XML 文档作为字符串传递给构造函数,它将 XML 文档转换为动态对象,其中的节点可作为对象的属性进行访问...

回答 1 投票 0

如何使用 Pandoc 将 css 样式传递到 html

我希望在 Windows 10 上使用 pandoc 3.0 将 docbook xml 输入转换为 html。 如何让 pandoc 识别文本颜色或其他文本样式?我的 docbooc xml 输入是 我希望在 Windows 10 上使用 pandoc 3.0 将 docbook xml 输入转换为 html。 如何让 pandoc 识别文本颜色或其他文本样式?我的 docbooc xml 输入是 <section id="body1"> <title>Section with a title</title> <para> In the year <emphasis role="red">1878</emphasis> I took my degree of Doctor of Medicine of the University of London, and proceeded to Netley to go through the course prescribed for surgeons in the army. Having completed my studies there, I was duly attached to the Fifth Northumberland Fusiliers as Assistant Surgeon. The regiment was stationed in India at the time, and before I could join it, the second Afghan war had broken out. </para> </section> 我希望 1878 以红色显示,类似于 <span style=xxx>1878</span>,其中提供的 CSS 会将 xxx 识别为 font-color: red。 我正在使用 pandoc --standalone --embed-resources --css=my.css -f docbook \ -t html -o foo.html` FWIW,我使用的是工作笔记本电脑,因此可能无法安装额外的 XML/XSL 软件。 我花了 2 天谷歌搜索这个,我已经阅读了 Sagehill 自定义内联内容,但我无法弄清楚如何实际应用自定义内联样式。另外,如果可能的话,我希望通过在 docbook XML 文档中包含 XSL 魔法来实现此目的。 在我所有的 SageHill 文档搜索中 这里 所以问题73652391可能最接近我想要的。但除非我遗漏了一些东西,否则 SageHill 的东西似乎需要 xsltproc 才能工作,即 Pandoc 不能做 xsltproc 可以做的事情。我想像这样的问题47474222也会起作用,但我不知道该怎么做。 我已经阅读并重新阅读了几十个问题,但它们似乎都指的是 Markdown 输入,这对我来说不是一个选择。我正在转换旧 XML 文档库来生成 HTML 并执行许多其他任务,因此 Markdown 输入等对我来说不是一个选择。 这里的主要问题是 pandoc 保留文档的结构,但不保留格式细节。文本颜色被视为格式细节。这种信息在第一步读入文档时就已经丢失,因此在其余步骤中无法保留它。信息丢失是由于 pandoc 的限制之一所致,请参阅此处。 一种选择可能是找到这些彩色文本的共同点,然后应用上述问答中的方法。例如,如果所有仅包含数字的强调元素都被着色为红色,那么像这样的 Lua 过滤器应该这样做: function Emph (em) if pandoc.utils.stringify(em):match '^[0-9]*$' then return pandoc.Span(em, {style="font-color:red"}) end end

回答 1 投票 0

解析 youtube rss feed

有没有像 ruby 一样快速干净地读取这些媒体键的示例? 我已经在使用 ruby rss 并且正在阅读标题、链接,但这些带分号的媒体键我无法阅读。我应该使用...

回答 2 投票 0

Android - 无法按预期设置按钮边框

我前几天刚开始学习Android。今天当我玩 Button 时,我注意到我无法按预期设置边框。 下面的 xml 文件: Activity_main.xml 中的按钮部分:...

回答 4 投票 0

如果字符串以另一个单词 regex perl 开头,则忽略该字符串

我正在阅读一个 XML 文件,其中我正在替换某些单词。我不想替换 XML 元素或属性中的单词。我使用消极的向后看和向前看,我已经完成了 90%。

回答 1 投票 0

访问下一个兄弟的文本

这是 jenkins xml 文件的一部分。 我想用 xpath 提取project_name 的defaultValue。 在本例中,该值是 *****。 ...

回答 2 投票 0

lxml(xml python 解析器)转到下一个元素

有人知道如何跳转到xml中的下一个元素吗? IE 文字编号2 文字...

回答 1 投票 0

为什么按钮上不显示边框?

我正在 Android Studio 中构建一个应用程序,我试图在按钮周围添加边框。 具体来说,这是一个我试图将其添加到的按钮: 我正在 Android Studio 中构建一个应用程序,并尝试在按钮周围添加边框。 具体来说,这是一个我试图将其添加到的按钮: <Button android:id="@+id/activitiesButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/activities" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/healthBeautyButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/mbCardButton" tools:ignore="VisualLintButtonSize" /> 这是整个文件 actvity_home.xml 的代码: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" style="@style/ButtonStyle" tools:ignore="SpeakableTextPresentCheck"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" tools:context=".HomeActivity" tools:ignore="Overdraw" android:layout_height="wrap_content"> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/virtual_card" android:textColor="#FEBE0F" android:textSize="27sp" android:textStyle="bold" android:gravity="center_horizontal" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="20sp" app:autoSizeMaxTextSize="25sp" app:autoSizeStepGranularity="1sp" android:paddingTop="10dp" android:paddingBottom="10dp" app:layout_constraintBottom_toTopOf="@+id/mbCardButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:ignore="TextSizeCheck" /> <ImageView android:id="@+id/mbCardButton" android:layout_width="0dp" android:layout_height="0dp" android:contentDescription="@string/mane_benefits_logo" app:layout_constraintBottom_toTopOf="@+id/activitiesButton" app:layout_constraintDimensionRatio="W,2:1" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/textView" app:srcCompat="@drawable/mb_card" tools:ignore="SpeakableTextPresentCheck,DuplicateSpeakableTextCheck,ImageContrastCheck" /> <Button android:id="@+id/activitiesButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/activities" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/healthBeautyButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/mbCardButton" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/healthBeautyButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/health_beauty" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/restaurantsButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/activitiesButton" tools:ignore="TextSizeCheck,VisualLintButtonSize" /> <Button android:id="@+id/restaurantsButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/restaurants" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/retailButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/healthBeautyButton" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/retailButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/retail" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/servicesButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/restaurantsButton" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/servicesButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/services" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/sevenPointsButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/retailButton" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/sevenPointsButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/_7_points" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/mbLogo" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/servicesButton" tools:ignore="VisualLintButtonSize" /> <ImageView android:id="@+id/ffcuLogo" android:layout_width="64dp" android:layout_height="74dp" android:layout_marginStart="0dp" android:layout_marginTop="0dp" android:layout_marginEnd="0dp" android:layout_marginBottom="20dp" android:contentDescription="@string/ffcu_logo" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/mbLogo" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/sevenPointsButton" app:srcCompat="@drawable/ffcu_logo" /> <ImageView android:id="@+id/mbLogo" android:layout_width="64dp" android:layout_height="74dp" android:layout_marginStart="0dp" android:layout_marginEnd="0dp" android:layout_marginBottom="20dp" android:contentDescription="@string/mane_benefits_logo" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/fbButton" app:layout_constraintStart_toEndOf="@+id/ffcuLogo" app:layout_constraintTop_toBottomOf="@+id/sevenPointsButton" app:srcCompat="@drawable/mb_logo_new" /> <ImageButton android:id="@+id/fbButton" android:layout_width="51dp" android:layout_height="76dp" android:layout_marginStart="0dp" android:layout_marginTop="0dp" android:layout_marginEnd="0dp" android:layout_marginBottom="20dp" android:contentDescription="@string/mb_fb_logo" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/instaButton" app:layout_constraintStart_toEndOf="@+id/mbLogo" app:layout_constraintTop_toBottomOf="@+id/sevenPointsButton" app:srcCompat="@drawable/mb_fb" tools:ignore="SpeakableTextPresentCheck" /> <ImageButton android:id="@+id/instaButton" android:layout_width="64dp" android:layout_height="68dp" android:layout_marginStart="0dp" android:layout_marginTop="0dp" android:layout_marginEnd="20dp" android:layout_marginBottom="20dp" android:contentDescription="@string/mb_insta_logo" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/fbButton" app:layout_constraintTop_toBottomOf="@+id/sevenPointsButton" app:srcCompat="@drawable/mb_insta" tools:ignore="SpeakableTextPresentCheck,ImageContrastCheck" /> </androidx.constraintlayout.widget.ConstraintLayout> </ScrollView> 这是 styles.xml: <resources> <style name="ButtonStyle" parent="Widget.AppCompat.Button"> <item name="android:background">@drawable/border</item> <!-- Reference the correct drawable name --> <item name="android:textColor">#FEBE0F</item> <!-- Text color --> <item name="android:textSize">18sp</item> <!-- Example text size --> <item name="android:padding">10dp</item> <!-- Example padding --> </style> </resources> 这是 border.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#632994" /> <!-- Background color --> <stroke android:width="5dp" android:color="#FEBE0F" /> <!-- Border color and width --> <corners android:radius="5dp" /> <!-- Rounded corners --> </shape> 在设计视图中,当我在 border.xml 中时,我看到边框,它看起来像这样: 但在我的 home_activity.xml 中它看起来像这样: 我尝试过让按钮的背景像边框一样 <Button android:id="@+id/sevenPointsButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" android:text="@string/_7_points" android:background="@drawable/border" android:textColor="#FEBE0F" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/mbLogo" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/servicesButton" tools:ignore="VisualLintButtonSize" /> 我什至将它放在整个视图周围,看看它是否有效,正如您从上面的图片中看到的那样。 除了将这些按钮设置为转到 HomeActivity.java 中的不同视图之外,没有其他任何东西会影响这些按钮: public class HomeActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); Button transitionButton = findViewById(R.id.activitiesButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,ActivitiesActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.healthBeautyButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,HealthBeautyActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.restaurantsButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,RestaurantsActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.retailButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,RetailActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.servicesButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,ServicesActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.sevenPointsButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,SevenPointsActivity.class); startActivity(intent); }); } } 尝试使用不同的按钮类型,因为这些按钮很难自定义 <androidx.appcompat.widget.AppCompatButton android:id="@+id/sevenPointsButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" android:text="@string/_7_points" android:background="@drawable/border" android:textColor="#FEBE0F" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/mbLogo" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/servicesButton" tools:ignore="VisualLintButtonSize" /> 试试这个

回答 1 投票 0

Libxml2:输出带有属性和内容的XML元素

我正在使用 libxml2 XMLTextWriter API(此处提供了官方示例)来输出 XML,但找不到任何示例或了解如何生成具有属性和内容的元素,...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.