pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<legend id='tNHlt'><style id='tNHlt'><dir id='tNHlt'><q id='tNHlt'></q></dir></style></legend>
  • <i id='tNHlt'><tr id='tNHlt'><dt id='tNHlt'><q id='tNHlt'><span id='tNHlt'><b id='tNHlt'><form id='tNHlt'><ins id='tNHlt'></ins><ul id='tNHlt'></ul><sub id='tNHlt'></sub></form><legend id='tNHlt'></legend><bdo id='tNHlt'><pre id='tNHlt'><center id='tNHlt'></center></pre></bdo></b><th id='tNHlt'></th></span></q></dt></tr></i><div class="f7nlhv9" id='tNHlt'><tfoot id='tNHlt'></tfoot><dl id='tNHlt'><fieldset id='tNHlt'></fieldset></dl></div>

      1. <tfoot id='tNHlt'></tfoot>

        <small id='tNHlt'></small><noframes id='tNHlt'>

        • <bdo id='tNHlt'></bdo><ul id='tNHlt'></ul>
      2. 使用 SQL 編輯 XML 列.不那么結構化的 XML

        Edit XML column using SQL . Not so structured XML(使用 SQL 編輯 XML 列.不那么結構化的 XML)

          <bdo id='HpVPy'></bdo><ul id='HpVPy'></ul>

          • <small id='HpVPy'></small><noframes id='HpVPy'>

            <tfoot id='HpVPy'></tfoot>

                <tbody id='HpVPy'></tbody>
              <legend id='HpVPy'><style id='HpVPy'><dir id='HpVPy'><q id='HpVPy'></q></dir></style></legend>

                  <i id='HpVPy'><tr id='HpVPy'><dt id='HpVPy'><q id='HpVPy'><span id='HpVPy'><b id='HpVPy'><form id='HpVPy'><ins id='HpVPy'></ins><ul id='HpVPy'></ul><sub id='HpVPy'></sub></form><legend id='HpVPy'></legend><bdo id='HpVPy'><pre id='HpVPy'><center id='HpVPy'></center></pre></bdo></b><th id='HpVPy'></th></span></q></dt></tr></i><div class="d57hbjr" id='HpVPy'><tfoot id='HpVPy'></tfoot><dl id='HpVPy'><fieldset id='HpVPy'></fieldset></dl></div>
                  本文介紹了使用 SQL 編輯 XML 列.不那么結構化的 XML的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  如何通過獲取XXX"的新標簽來編輯 XML,而不是結構化的 xml.需要幫助,我對 XML 和 XQuery 非常陌生.如果 X 沒有,則必須為 X 獲取新標簽(節點),在 1 的情況下只需要插入 1.有沒有辦法在更大范圍內操作字符串

                  How to edit XML by getting new tags for 'XXX', not so structured xml. Need help, I am very new to XML and XQuery. Have to get new tags (nodes) for X if it is none, in case of 1 need to insert 1 only. is there any way to manipulate string on larger scale

                  <NewAttributeRules>
                  <items>
                  <NewAttributeItem>
                    <Scale>CAAA</Scale>
                    <ScaleName>OC07</ScaleName>
                    <comment />
                    <positiveRules>
                      <NewAttributeRule type="POSITIVE">
                        <conditions>
                          <InCondition column="PPRD" colDataType="STRING">
                            <values>
                              <string>CAAAEXTENDED</string>
                            </values>
                          </InCondition>
                        </conditions>
                      </NewAttributeRule>
                    </positiveRules>
                    <negativeRules />
                   </NewAttributeItem>
                  
                  
                   <NewAttributeItem>
                    <Scale>high TOTAL OTHERS</Scale>
                    <ScaleName>b007</ScaleName>
                    <comment />
                    <positiveRules>
                      <NewAttributeRule type="POSITIVE">
                        <conditions>
                          <InCondition column="ATC3" colDataType="STRING">
                            <values>
                              <string>B10787 EXT</string>
                            </values>
                          </InCondition>
                        </conditions>
                      </NewAttributeRule>
                    </positiveRules>
                    <negativeRules>
                      <NewAttributeRule type="NEGATIVE">
                        <conditions>
                          <InCondition column="PPRD" colDataType="STRING">
                            <values>
                              <string>hkJKKK</string>
                              <string>GAGHA</string>
                              </values>
                          </InCondition>
                        </conditions>
                      </NewAttributeRule>
                      </negativeRules>
                     </NewAttributeItem>
                        
                  
                  <NewAttributeItem>
                    <Scale>***XXX***</Scale>
                    <ScaleName>OC07</ScaleName>
                    <comment />
                    <positiveRules />
                    <negativeRules />
                  </NewAttributeItem>
                  <NewAttributeItem>
                    <Scale>***XXX***</Scale>
                    <ScaleName>OC07</ScaleName>
                    <comment />
                    <positiveRules />
                    <negativeRules />
                   </NewAttributeItem>
                  
                  <NewAttributeItem>
                    <Scale>***XXX***</Scale>
                    <ScaleName>b007</ScaleName>
                    <comment />
                    <positiveRules />
                    <negativeRules />
                   </NewAttributeItem>
                  <NewAttributeItem>
                    <Scale>***XXX***</Scale>
                    <ScaleName>b007</ScaleName>
                    <comment />
                    <positiveRules />
                    <negativeRules />
                   </NewAttributeItem>
                  
                  </items>
                  </NewAttributeRules>
                  

                  推薦答案

                  好的,現在 XML 是有效的...

                  Okay, now the XML is valid...

                  連同來自您的其他問題的信息,我建議采用這種方法:

                  Together with the information form your other question I'd suggest this approach:

                  我把你的 XML 放入一個聲明的變量中

                  I put your XML into a declared variable

                  declare @xml xml=
                  N'<NewAttributeRules>
                    <items>
                      <NewAttributeItem>
                        <Scale>CAAA</Scale>
                        <ScaleName>OC07</ScaleName>
                        <comment />
                        <positiveRules>
                          <NewAttributeRule type="POSITIVE">
                            <conditions>
                              <InCondition column="PPRD" colDataType="STRING">
                                <values>
                                  <string>CAAAEXTENDED</string>
                                </values>
                              </InCondition>
                            </conditions>
                          </NewAttributeRule>
                        </positiveRules>
                        <negativeRules />
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>high TOTAL OTHERS</Scale>
                        <ScaleName>b007</ScaleName>
                        <comment />
                        <positiveRules>
                          <NewAttributeRule type="POSITIVE">
                            <conditions>
                              <InCondition column="ATC3" colDataType="STRING">
                                <values>
                                  <string>B10787 EXT</string>
                                </values>
                              </InCondition>
                            </conditions>
                          </NewAttributeRule>
                        </positiveRules>
                        <negativeRules>
                          <NewAttributeRule type="NEGATIVE">
                            <conditions>
                              <InCondition column="PPRD" colDataType="STRING">
                                <values>
                                  <string>hkJKKK</string>
                                  <string>GAGHA</string>
                                </values>
                              </InCondition>
                            </conditions>
                          </NewAttributeRule>
                        </negativeRules>
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>***XXX***</Scale>
                        <ScaleName>OC07</ScaleName>
                        <comment />
                        <positiveRules />
                        <negativeRules />
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>***XXX***</Scale>
                        <ScaleName>OC07</ScaleName>
                        <comment />
                        <positiveRules />
                        <negativeRules />
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>***XXX***</Scale>
                        <ScaleName>b007</ScaleName>
                        <comment />
                        <positiveRules />
                        <negativeRules />
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>***XXX***</Scale>
                        <ScaleName>b007</ScaleName>
                        <comment />
                        <positiveRules />
                        <negativeRules />
                      </NewAttributeItem>
                    </items>
                  </NewAttributeRules>';
                  

                  --和之前一樣,CTE 將讀取 ScaleName 以供稍后分組,但會讓整個節點 保持原樣

                  --As before, the CTE will read the ScaleName for later grouping, but will let the whole node as is

                  WITH ScaleNames AS
                  (
                      SELECT  ai.query('.') AS AiNode
                             ,ai.value('(ScaleName)[1]','nvarchar(100)') AS ScaleName
                      FROM @xml.nodes('/NewAttributeRules/items/NewAttributeItem') AS A(ai)
                      WHERE ai.value('(Scale)[1]','nvarchar(100)')<>'***XXX***'
                  )
                  

                  --此 SELECT 將使用現有節點重建整個 XML,并添加兩倍的 XXX 節點.

                  --This SELECT will rebuild the whole XML using the existing nodes and adding two times the XXX nodes.

                  SELECT
                  (
                      SELECT (
                                  SELECT x.AiNode AS [node()]
                                  FROM ScaleNames AS x
                                  WHERE x.ScaleName=ScaleNames.ScaleName
                                  FOR XML PATH(''),TYPE
                             ) AS [node()]
                            ,(SELECT
                               (SELECT '***XXX***' AS Scale, ScaleName, '' AS comment, '' AS positiveRules, '' AS negativRules FOR XML PATH('NewAttributeItem'),TYPE )
                              ,(SELECT '***XXX***' AS Scale, ScaleName, '' AS comment, '' AS positiveRules, '' AS negativRules FOR XML PATH('NewAttributeItem'),TYPE)
                              FOR XML PATH(''),TYPE
                             ) AS [node()]
                      FROM ScaleNames
                      GROUP BY ScaleName
                      ORDER BY ScaleName
                      FOR XML PATH(''),ROOT('items'),TYPE
                  )
                  FOR XML PATH(''),ROOT('NewAttributeRules')
                  

                  結果

                  <NewAttributeRules>
                    <items>
                      <NewAttributeItem>
                        <Scale>high TOTAL OTHERS</Scale>
                        <ScaleName>b007</ScaleName>
                        <comment />
                        <positiveRules>
                          <NewAttributeRule type="POSITIVE">
                            <conditions>
                              <InCondition column="ATC3" colDataType="STRING">
                                <values>
                                  <string>B10787 EXT</string>
                                </values>
                              </InCondition>
                            </conditions>
                          </NewAttributeRule>
                        </positiveRules>
                        <negativeRules>
                          <NewAttributeRule type="NEGATIVE">
                            <conditions>
                              <InCondition column="PPRD" colDataType="STRING">
                                <values>
                                  <string>hkJKKK</string>
                                  <string>GAGHA</string>
                                </values>
                              </InCondition>
                            </conditions>
                          </NewAttributeRule>
                        </negativeRules>
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>***XXX***</Scale>
                        <ScaleName>b007</ScaleName>
                        <comment />
                        <positiveRules />
                        <negativRules />
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>***XXX***</Scale>
                        <ScaleName>b007</ScaleName>
                        <comment />
                        <positiveRules />
                        <negativRules />
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>CAAA</Scale>
                        <ScaleName>OC07</ScaleName>
                        <comment />
                        <positiveRules>
                          <NewAttributeRule type="POSITIVE">
                            <conditions>
                              <InCondition column="PPRD" colDataType="STRING">
                                <values>
                                  <string>CAAAEXTENDED</string>
                                </values>
                              </InCondition>
                            </conditions>
                          </NewAttributeRule>
                        </positiveRules>
                        <negativeRules />
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>***XXX***</Scale>
                        <ScaleName>OC07</ScaleName>
                        <comment />
                        <positiveRules />
                        <negativRules />
                      </NewAttributeItem>
                      <NewAttributeItem>
                        <Scale>***XXX***</Scale>
                        <ScaleName>OC07</ScaleName>
                        <comment />
                        <positiveRules />
                        <negativRules />
                      </NewAttributeItem>
                    </items>
                  </NewAttributeRules>
                  

                  這篇關于使用 SQL 編輯 XML 列.不那么結構化的 XML的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數據庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發
                  How to create a login to a SQL Server instance?(如何創建對 SQL Server 實例的登錄?)
                  How to know the version and edition of SQL Server through registry search(如何通過注冊表搜索知道SQL Server的版本和版本)
                  Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會出現“數據類型轉換錯誤?使用 ExecuteNonQuery()?)
                  How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)
                  WinForms application design - moving documents from SQL Server to file storage(WinForms 應用程序設計——將文檔從 SQL Server 移動到文件存儲)
                  1. <i id='Vhp1i'><tr id='Vhp1i'><dt id='Vhp1i'><q id='Vhp1i'><span id='Vhp1i'><b id='Vhp1i'><form id='Vhp1i'><ins id='Vhp1i'></ins><ul id='Vhp1i'></ul><sub id='Vhp1i'></sub></form><legend id='Vhp1i'></legend><bdo id='Vhp1i'><pre id='Vhp1i'><center id='Vhp1i'></center></pre></bdo></b><th id='Vhp1i'></th></span></q></dt></tr></i><div class="l7hl7xp" id='Vhp1i'><tfoot id='Vhp1i'></tfoot><dl id='Vhp1i'><fieldset id='Vhp1i'></fieldset></dl></div>

                          <bdo id='Vhp1i'></bdo><ul id='Vhp1i'></ul>

                          <small id='Vhp1i'></small><noframes id='Vhp1i'>

                        • <tfoot id='Vhp1i'></tfoot>
                            <tbody id='Vhp1i'></tbody>
                          <legend id='Vhp1i'><style id='Vhp1i'><dir id='Vhp1i'><q id='Vhp1i'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 广州昊至泉水上乐园设备有限公司| 超声骨密度仪-动脉硬化检测仪器-人体成分分析仪厂家/品牌/价格_南京科力悦 | 蓝鹏测控平台 - 智慧车间系统 - 车间生产数据采集与分析系统 | 陕西华春网络科技股份有限公司 | 工业雾炮机_超细雾炮_远程抑尘射雾器-世纪润德环保设备 | 日本细胞免疫疗法_肿瘤免疫治疗_NK细胞疗法 - 免疫密码 | 氢氧化钙设备, 氢氧化钙生产线-淄博惠琛工贸有限公司 | 气体检测仪-氢气检测仪-可燃气体传感器-恶臭电子鼻-深国安电子 | 家庭教育吧-在线家庭教育平台,专注青少年家庭教育 | PTFE接头|聚四氟乙烯螺丝|阀门|薄膜|消解罐|聚四氟乙烯球-嘉兴市方圆氟塑制品有限公司 | 山东聚盛新型材料有限公司-纳米防腐隔热彩铝板和纳米防腐隔热板以及钛锡板、PVDF氟膜板供应商 | 临沂招聘网_人才市场_招聘信息_求职招聘找工作请认准【马头商标】 | 今日娱乐圈——影视剧集_八卦娱乐_明星八卦_最新娱乐八卦新闻 | 日本细胞免疫疗法_肿瘤免疫治疗_NK细胞疗法 - 免疫密码 | 运动木地板厂家,篮球场木地板品牌,体育场馆木地板安装 - 欧氏运动地板 | 海南在线 海南一家 | QQ房产导航-免费收录优秀房地产网站_房地产信息网 | 净化车间装修_合肥厂房无尘室设计_合肥工厂洁净工程装修公司-安徽盛世和居装饰 | 阻垢剂-反渗透缓蚀阻垢剂厂家-山东鲁东环保科技有限公司 | 吸污车_吸粪车_抽粪车_电动三轮吸粪车_真空吸污车_高压清洗吸污车-远大汽车制造有限公司 | 不锈钢螺丝,不锈钢螺栓,不锈钢标准件-江苏百德特种合金有限公司 交变/复合盐雾试验箱-高低温冲击试验箱_安奈设备产品供应杭州/江苏南京/安徽马鞍山合肥等全国各地 | 博客-悦享汽车品质生活 | 万师讲师网-优质讲师培训师供应商,讲师认证,找讲师来万师 | 水稻烘干机,小麦烘干机,大豆烘干机,玉米烘干机,粮食烘干机_巩义市锦华粮食烘干机械制造有限公司 水环真空泵厂家,2bv真空泵,2be真空泵-淄博真空设备厂 | 北京三友信电子科技有限公司-ETC高速自动栏杆机|ETC机柜|激光车辆轮廓测量仪|嵌入式车道控制器 | 贴片电感_贴片功率电感_贴片绕线电感_深圳市百斯特电子有限公司 贴片电容代理-三星电容-村田电容-风华电容-国巨电容-深圳市昂洋科技有限公司 | 高精度电阻回路测试仪-回路直流电阻测试仪-武汉特高压电力科技有限公司 | 美名宝起名网-在线宝宝、公司、起名平台 | 耐高温电缆厂家-远洋高温电缆| 电磁流量计_智能防腐防爆管道式计量表-金湖凯铭仪表有限公司 | 污水处理设备,一体化泵站,一体化净水设备-「梦之洁环保设备厂家」 | 北京银联移动POS机办理_收银POS机_智能pos机_刷卡机_收银系统_个人POS机-谷骐科技【官网】 | 企典软件一站式企业管理平台,可私有、本地化部署!在线CRM客户关系管理系统|移动办公OA管理系统|HR人事管理系统|人力 | 123悬赏网_发布悬赏任务_广告任务平台 | 灌装封尾机_胶水灌装机_软管灌装封尾机_无锡和博自动化机械制造有限公司 | 体视显微镜_荧光生物显微镜_显微镜报价-微仪光电生命科学显微镜有限公司 | 杭州公司变更法人-代理记账收费价格-公司注销代办_杭州福道财务管理咨询有限公司 | 粉末包装机-给袋式包装机-全自动包装机-颗粒-液体-食品-酱腌菜包装机生产线【润立机械】 | 北京网站建设公司_北京网站制作公司_北京网站设计公司-北京爱品特网站建站公司 | 电动葫芦|环链电动葫芦-北京凌鹰名优起重葫芦 | 杭州月嫂技术培训服务公司-催乳师培训中心报名费用-产后康复师培训机构-杭州优贝姆健康管理有限公司 |