Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all 935 articles
Browse latest View live

how to keep the same background color in ambient mode

$
0
0

Hi everyone,
I am creating a digital watch face where you can edit the background image, the problem is that in ambient mode it does not keep the same chosen background.
Anyone know where I am going wrong ???

<root height="360" type="normal" width="360" x="0" y="0"><image action_type="image-set" height="360" id="Background_1.0" name="Background 1.0.png" tap="double-tap" width="360" x="0" y="0"><image-set><image>action/image/Background 1.1.png</image><image>action/image/Background 2.0.png</image><image>action/image/Background 2.1.png</image><image>action/image/Background 3.0.png</image><image>action/image/Background 3.1.png</image></image-set></image><image height="360" id="Image_1.0" name="Image 1.0.png" width="360" x="0" y="0"/></root><root height="360" type="ambient-fullcolor" width="360" x="0" y="0"><image height="360" id="Background_1.0" name="Background 1.0.png" width="360" x="0" y="0"/><image height="360" id="Image_1.0" name="Image 1.0" width="360" x="0" y="0"/></root></watchface>



How to add the xmlElement from one xsd file within the xmlElement of another xsd file using XmlSampleGenerator?

$
0
0

Hi,

I'm using XmlSampleGenerator to generate the xml file from xsd. I'm able to generate the xml file from single xsd file directly using bellow code.

using (var stream = new MemoryStream(File.ReadAllBytes("platform-container.xsd")))
        {
            var schema = XmlSchema.Read(XmlReader.Create(stream), null);
            var gen = new XmlSampleGenerator(schema, new XmlQualifiedName("Document"));
            gen.WriteXml(XmlWriter.Create(@"C:\SCIP\SCIP-Phase-1\SCIPAppPrj\XmlFiles\dossier.i6d"));
            Console.WriteLine("Autogenerated file is here : C:\\SCIP\\SCIP-Phase-1\\SCIPAppPrj\\XmlFiles\\dossier.i6d");
        }

But I'm facing the issue when I have to combine the elements from multiple xsd files and generate one single xml file. For example my generated xml should look like below:

<?xml version="1.0" encoding="UTF-8"?><i6c:Document xmlns:i6c="http://iuclid6.echa.europa.eu/namespaces/platform-container/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://iuclid6.echa.europa.eu/namespaces/platform-container/v1 container.xsd"><i6c:PlatformMetadata xmlns:i6m="http://iuclid6.echa.europa.eu/namespaces/platform-metadata/v1" xsi:schemaLocation="http://iuclid6.echa.europa.eu/namespaces/platform-container/v1 container.xsd"><i6m:iuclidVersion>1.0</i6m:iuclidVersion><i6m:documentKey>ABC</i6m:documentKey><i6m:documentType>DOSSIER</i6m:documentType></i6c:PlatformMetadata><i6c:Content><DOSSIER.SCIP xmlns="http://iuclid6.echa.europa.eu/namespaces/DOSSIER-SCIP/1.0" xmlns:i6="http://iuclid6.echa.europa.eu/namespaces/platform-fields/v1" /></i6c:Content></i6c:Document>


I have main xsd called container.xsd, which has skeleton for my xml file. Also metaData.xsd and content.xsd which contains elements that should be included as a child under one of the element present in container.xsd.

container.xsd

<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns="http://iuclid6.echa.europa.eu/namespaces/platform-container/v1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://iuclid6.echa.europa.eu/namespaces/platform-container/v1"
elementFormDefault="qualified" attributeFormDefault="qualified"><xs:element name="Document"><xs:complexType><xs:sequence><xs:element name="PlatformMetadata"><xs:complexType><xs:sequence maxOccurs="unbounded"><xs:any namespace="##other" processContents="lax" minOccurs="0"/></xs:sequence></xs:complexType></xs:element><xs:element name="Content"><xs:complexType><xs:sequence><xs:any namespace="##other" processContents="strict" minOccurs="0"/></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:schema>

metaData.xsd

<xs:schema xmlns="http://iuclid6.echa.europa.eu/namespaces/platform-metadata/v1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://iuclid6.echa.europa.eu/namespaces/platform-metadata/v1"
elementFormDefault="qualified" attributeFormDefault="qualified"><xs:element name="iuclidVersion" type="xs:string"></xs:element><xs:element name="documentKey" type="xs:string"></xs:element><xs:element name="documentType" type="xs:string"></xs:element></xs:schema>

content.xsd

<?xml version="1.0" encoding="UTF-8" standalone="no"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://iuclid6.echa.europa.eu/namespaces/DOSSIER-SCIP/1.0" xmlns:ct="http://iuclid6.echa.europa.eu/namespaces/scip/v1" xmlns:i6="http://iuclid6.echa.europa.eu/namespaces/platform-fields/v1" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://iuclid6.echa.europa.eu/namespaces/DOSSIER-SCIP/1.0"><xs:import namespace="http://iuclid6.echa.europa.eu/namespaces/platform-fields/v1" schemaLocation="platform-fields.xsd"/><xs:import namespace="http://iuclid6.echa.europa.eu/namespaces/scip/v1" schemaLocation="commonTypesScipV1.xsd"/><xs:element name="DOSSIER.SCIP"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="remarks" type="xs:string"/></xs:sequence></xs:complexType></xs:element></xs:schema>

Can anyone suggest me how to handle this using XmlSampleGenerator? How to read the elements from multiple xsd's and genrate single xml file ? How to append the data for each element ? And How to loop through repeatable element ?

Thanks and Regards,

Bhavya

Xpath syntax for SelectNodes (and/or)

$
0
0

I have the following XML and I am trying to determine the correct XPath syntax to return the count of records where the "Division" node text = "Contracting" and the "Age" node text > 34.

I would like to return the 1 record containing Joe Miller and the following fails with a syntax error (Expected token 'EOF' found 'Name')

MsgBox oXMLPart.SelectNodes("//ns0:Division[text() = 'Contracting'] and //ns0:Age[text() > '34']").Count

Individually,
MsgBox oXMLPart.SelectNodes("//ns0:Division [text() = 'Contracting']").Count
MsgBox oXMLPart.SelectNodes("//ns0:Age[text() >  '34']").Count

Returns 2 and 1 records as expected.

<?xml version="1.0"?><CC_Map_Root xmlns="http://TheAnchorage.com/XMLPart"><Employees xmlns="http://TheAnchorage.com/XMLPart"><EmployeeID>111</EmployeeID><Name>Joe Miller</Name><Age>38</Age><HireDate>2000-09-14</HireDate><Division>Contracting</Division></Employees><Employees xmlns="http://TheAnchorage.com/XMLPart"><EmployeeID>1231</EmployeeID><Name>Tom Smith</Name><Age>33</Age><HireDate>2011-05-09</HireDate><Division>Contracting</Division></Employees><Employees xmlns="http://TheAnchorage.com/XMLPart"><EmployeeID>342</EmployeeID><Name>Tom Armstrong</Name><Age>60</Age><HireDate>1994-05-170</HireDate><Division>Maintenance</Division></Employees></CC_Map_Root>
Can this sort of query be performed?  If so, please assist with the correct syntax.  Thank you.


Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm




Is there any way to enter errors/Warnings in the XML file which I am validating against DTD?

$
0
0

Hello Everyone,
I am validating my XML file with some DTD using some C# logic. I have to provide error details to my client in the same XML file which I am validating against DTD without using Schematron.
Is there any solution to achieve that in C#?

Example: Before validating my XML file:
< A>
 <B></B>
 <D></D>
< /A>

After validating my XML file:
< A>
 <B></B>
< !-- Error/Warning: Incorrect sequence. C Element is missing [Something like that] -->
 <D></D>
< /A>

Means, program should automatically adds the errors/warnings (from the DTD validation) to the lines where the errors are. 

Any Ideas?
Thanks,


Shahab Abbasi

Internet Explorer 11 MSXML Standard Support for XML Transformation

$
0
0
Hi,

I have read through few Microsoft documentation website about MSXML Standard Support, specifically "https://docs.microsoft.com/en-us/previous-versions/windows/desktop/jj152146(v=vs.85)" but seems like the documentation is outdated. Therefore, I have a few questions.

1. Is it possible to find the updated roadmap for MSXML Standard Support for XML Transformation for IE11 and Edge future release ?

2. From the documentation, it seems like MSXML6.0 not supporting for XML Transformation Working Draft version but another documentation "https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms764682(v=vs.85)" stated MSXML6.0  support backward compatibility. So, does MSXML6.0  support XSLT-WD or not?

3. Is it possible to find the list of unsupported feature of XSLT working draft in IE11 from official Microsoft documentation?

Thanks

How can i compress\uncompress (zip\unzip) multiple files using ADF.?

Startindex cannot be less than zero when trying to create a sample xml file from a xsd file

$
0
0

Using Visual studio pro 2015

I have a xsd file and need to generate a xml sample file from it.
Ive opened the file with the XML editor. When i Try to "Generate Sample XML", I'm met with the following:

Have anyone experienced this?

Any hints or tips on how to find the fault are welcome!

brgs

Bjørn

Xml reader for special character

$
0
0
I have a below xml file.

<?xml version="1.0" encoding="iso-8859-1"?>
<bcreport created="20-Jun-2020 6:28:13 PM">
<filecomparison created="20-Jun-2020 6:28:12 PM">
<filename1>\\PC3\D\test1.bas</filename1>
<filename2>\\PC3\D\test2.bas</filename2>
<linecomp status="same">
<text ltid="1" rtid="1">Attribute VB_Name = "test"</text>
</linecomp>
<linecomp status="same">
<text ltid="2" rtid="2"> If Trim(RRRnum) "" Then RRRnum = RRRnum &amp; "|"</text>
</linecomp>
<linecomp status="same">
<text ltid="3" rtid="3">'to remove special chars like &Amp;-case sensitive</text>
</linecomp>
</filecomparison>
</bcreport>

Here '&amp;' in line "If Trim(RRRnum) "" Then RRRnum = RRRnum &amp;" is the special character.
And '&Amp;' in line "to remove special chars like &amp;-case sensitive" is not a special character.

The code used for reading xml file.
       Dim reader As XmlTextReader = New XmlTextReader("D:\file_1.xml")       reader.EntityHandling = EntityHandling.ExpandEntities        
       Dim xDoc As XmlDocument = New XmlDocument()        
       xDoc.Load(reader)       
       Dim nodeReader As XmlNodeReader = New 
       XmlNodeReader(xDoc)             DtXmlTbl.ReadXml(nodeReader)             nodeReader.Close()

But i will get a error:Reference to undeclared entity 'AMP'.

How to solve this error?

 


SignedXML.CheckSignature Always Fails

$
0
0
I don't think I posted my original question in the correct forum, so I'm going to close that one and post here.

I'm currently working on a project which requires the XML posts to be digitally signed. I do not seem to have any luck with getting any test posts from our client to validate with the below code:

publicstaticbool verifySignature(string xmlData)

{



    XmlDocument theDocument = new XmlDocument();

    XmlNodeList nodeList;

    SignedXml signedDocument;



    theDocument.PreserveWhitespace = true;

    theDocument.LoadXml(xmlData);

    signedDocument = new SignedXml(theDocument);



    nodeList = theDocument.GetElementsByTagName(

        "ds:Signature");



    signedDocument.LoadXml((XmlElement)nodeList[0]);



     return signedDocument.CheckSignature();



}


The posts are signed using the XML Signature tag with a namespace of "ds". I am simply base64 decoding the post and sending it straight to here without any modifications of whitespace or casing.

Any help would be greatly appreciated!

- Jake

I need to upload media content (video or image) storage in SQL Azure to Azure BLOB Container

$
0
0

Actually the information is stored in BASE64 in a varchar field. I've created a stored procedure to convert that field into VARBINARY. With the following code:

cast(N'' as xml).value('xs:base64Binary(sql:column("[name of the column]"))', 'varbinary(MAX)')

The result is shown in the following picture:

The media is storage (SQL Azure) in Varbinary, after storing the media content as file in the BLOB Container, I cannot be able to render the media to watch its content if I donwload it in my local computer. Even If I try to open the file with a local editor I can see the same value as the image shows above. All the convertion process is running in Azure SQL Server and call it using a ADF process.

What is the best approach to load those media using Azure Data Factory? Is it another way to save BASE64 to image from SQL to Blob storage in AZURE? Thanks

How To Activate Cash App Card

$
0
0
Activate cash app card yourself with proper informative blog on how to activate cash app card on your cash app mobile application yourself. https://greentrustcashapplication.com/how-to-activate-cash-app-card/

Cosmos DB - Database level Access

$
0
0

How can I Prevent a user to not access a database in a Cosmos DB Account?

Scenario - There are 5 databases and I don't want User 1 to access the data for Database 2, how this can be achieved?

Hyphen getting saved as illegal character in xml file

$
0
0

My input has Hyphen like Cloud license and on-premise license but it is saved in xml like below screen shot. a illegal character is there.

when saving this text in xml then a illegal character is saving instead of Hyphen. so please advise me how to prevent to save illegal character in xml file? and Hyphen should be always as Hyphen in xml file instead of illegal character.

please advise. thanks

XML digital signature Web service SOAP

$
0
0

Hi to everyone, 

I have web proxy and a few methods there. When the XML has not digital signature, the method that is required is invoked and everything is cool, but if the XML has digital signature, the method is not invoked.

where should i focus to find the mistake ?

this is a problem that i have to find options that are likely to be close to the right answer

How to validate is number is valid year or not by RegEx

$
0
0

suppose number is 2009 or 2019 and it is a valid year but 19 is not valid year. so how could i validate a number is valid year not by RegEx. i found a code and it is working but i am not being able to understand the Regex used there.

if (Regex.IsMatch("2019", "^(19|20)[0-9][0-9]"))
{}

what is the meaning of 19 or 20 used there ?

why two [0-9] set is used there ?

please help me to understand the RegEx. thanks


Viewing all 935 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>