Menu
  • HOME
  • TAGS

Get XML node value when previous node value conditions are true (without looping)

Tag: xml,vb.net,linq-to-xml

Sample XML -

<?xml version="1.0"?>
<Root>
  <PhoneType dataType="string">
    <Value>CELL</Value>
  </PhoneType>
  <PhonePrimaryYn dataType="string">
    <Value>Y</Value>
  </PhonePrimaryYn>
  <PhoneNumber dataType="string">
    <Value>555-555-5554</Value>
  </PhoneNumber>
  <PhonePrimaryYn dataType="string">
    <Value>Y</Value>
  </PhonePrimaryYn>
  <PhoneType dataType="string">
    <Value>HOME</Value>
  </PhoneType>
  <PhoneNumber dataType="string">
    <Value>555-555-5555</Value>
  </PhoneNumber>    
</Root>

Without looping through each nodelist, can someone tell me (either with LINQ-to-XML or by other means) how I can perform the following?

In the XML sample you see two groups of 'PhoneType', 'PhonePrimaryYn', and 'PhoneNumber' type code groups. The first group of three relate to each other. The second group of three relate to each other as well, and so on.

Lets say I want to know what the cell phone number is.

I get that cell phone number when the 'PhoneType' 'Value' is 'CELL', the 'PhonePrimaryYn' 'Value' is 'Y', I get that 'PhoneNumber' 'Value' of '555-555-5554'. You get the idea hopefully.

I'd like to know if it is possible to get that 'PhoneNumber' value (cell phone for example) without having to loop through each nodelist group of the particular type.

Do anyone have any ideas?

Best How To :

UPDATE

Using an XDocument vs an XmlDocument, I believe this does what you're asking without using loops.

This is dependent on the elements being in the order of

<PhoneType> <PhonePrimaryYN> <PhoneNumber>

string xml = "<?xml version=\"1.0\"?>" +
    "<Root>" + 
    "  <PhoneType dataType=\"string\">" + 
    "    <Value>CELL</Value>" + 
    "  </PhoneType>" + 
    "  <PhonePrimaryYn dataType=\"string\">" + 
    "    <Value>Y</Value>" + 
    "  </PhonePrimaryYn>" + 
    "  <PhoneNumber dataType=\"string\">" + 
    "    <Value>555-555-5554</Value>" + 
    "  </PhoneNumber>" + 
    "  <PhonePrimaryYn dataType=\"string\">" + 
    "    <Value>Y</Value>" + 
    "  </PhonePrimaryYn>" + 
    "  <PhoneType dataType=\"string\">" + 
    "    <Value>HOME</Value>" + 
    "  </PhoneType>" + 
    "  <PhoneNumber dataType=\"string\">" + 
    "    <Value>555-555-5555</Value>" + 
    "  </PhoneNumber>    " +
    "  <PhoneType dataType=\"string\">" +
    "    <Value>CELL</Value>" +
    "  </PhoneType>" +
    "  <PhonePrimaryYn dataType=\"string\">" +
    "    <Value>Y</Value>" +
    "  </PhonePrimaryYn>" +
    "  <PhoneNumber dataType=\"string\">" +
    "    <Value>555-555-9999</Value>" +
    "  </PhoneNumber>" + 
    "</Root>";

XDocument xDoc = XDocument.Parse(xml);
if (xDoc.Root != null)
{
    var tmp = (from item in xDoc.Root.Descendants()
                where item.Name == "PhoneType" && item.Value == "CELL"
                select new
                            {
                                PhoneNumber = item.NextNode.NextNode
                            }).ToList();

    for (int i = 0; i < tmp.Count; i++)
    {
        Console.WriteLine(((XElement)tmp[i].PhoneNumber).Value);
    }
}

Results:

555-555-5554
555-555-9999

OLD ANSWER

When I loaded your sample XML into an XmlDocument I saw that it's InnerText property contained the following:

CELLY555-555-5554YHOME555-555-5555

From here, I thought Regex would be a good method for extracting CELL numbers using the pattern:

"CELL[NY](\\d{3}-\\d{3}-\\d{4})"

The pattern looks for the word "CELL", followed by a 'N' or 'Y', then the phone number in the format ###-###-#####. The phone number is in a capture group and if a match is found it can be accessed like this following example illustrates.

I added another CELL entry to show that you can get all CELL numbers in your XML. So the InnerText property, of the XmlDocument, now looks like

CELLY555-555-5554YHOME555-555-5555CELLY555-555-9999

XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml("<?xml version=\"1.0\"?>" +
    "<Root>" + 
    "  <PhoneType dataType=\"string\">" + 
    "    <Value>CELL</Value>" + 
    "  </PhoneType>" + 
    "  <PhonePrimaryYn dataType=\"string\">" + 
    "    <Value>Y</Value>" + 
    "  </PhonePrimaryYn>" + 
    "  <PhoneNumber dataType=\"string\">" + 
    "    <Value>555-555-5554</Value>" + 
    "  </PhoneNumber>" + 
    "  <PhonePrimaryYn dataType=\"string\">" + 
    "    <Value>Y</Value>" + 
    "  </PhonePrimaryYn>" + 
    "  <PhoneType dataType=\"string\">" + 
    "    <Value>HOME</Value>" + 
    "  </PhoneType>" + 
    "  <PhoneNumber dataType=\"string\">" + 
    "    <Value>555-555-5555</Value>" + 
    "  </PhoneNumber>    " +
    "  <PhoneType dataType=\"string\">" +
    "    <Value>CELL</Value>" +
    "  </PhoneType>" +
    "  <PhonePrimaryYn dataType=\"string\">" +
    "    <Value>Y</Value>" +
    "  </PhonePrimaryYn>" +
    "  <PhoneNumber dataType=\"string\">" +
    "    <Value>555-555-9999</Value>" +
    "  </PhoneNumber>" + 
    "</Root>");

Match match = Regex.Match(xmlDocument.InnerText, "CELL[NY](\\d{3}-\\d{3}-\\d{4})");
while (match.Success)
{
    Console.WriteLine(match.Groups[1]);
    match = match.NextMatch();
}

Results:

555-555-5554
555-555-9999

Tagging values in HTML document for automated extraction

html,xml,html5

If you are using them as meta-documents and they are sent to the parser, then converted as HTML and as long as the converted HTMLs do not have any irrelevant tags, it is fine! So, if the following code: <requirement> THE REQUIREMENT HERE </requirement> Gets converted into something like: <!--...

Convert date to string format

vb.net,converter

Your approach doesn't work because you are using ToString on a DataColumn which has no such overload like DateTime. That doesn't work anyway. The only way with the DataTable was if you'd add another string-column with the appropriate format in each row. You should instead use the DataGridViewColumn's DefaultCellStyle: InvestorGridView.Columns(1).DefaultCellStyle.Format...

Parsing XML array using Jquery

javascript,jquery,xml,jquery-mobile

EMI and CustomerName are elements under json so you can use .find() to find those elements and then text() to get its value. $(data).find("json").each(function (i, item) { var heures = $(item).find("CustomerName").text(); var nbr = $(item).find("EMI").text(); console.log(heures); }); .attr() is used to get the attribute value of an element like in...

odoo v8 - Field(s) `arch` failed against a constraint: Invalid view definition

python,xml,view,odoo,add-on

You have made silly mistake in defining _columns. _colums is not valid dictionary name for fields structure. Replace this by _columns and restart service and update module. ...

VB.Net DateTime conversion

jquery,vb.net,datetime

System.Globalization.DateTimeFormatInfo.InvariantInfo doesn't contain format pattern dd-MM-yyyy(26-06-2015) From MSDN about InvariantCulture The InvariantCulture property can be used to persist data in a culture-independent format. This provides a known format that does not change For using invariant format in converting string to DateTime your string value must be formatted with one of...

How do I use VB.NET to send an email from an Outlook account?

vb.net,email

change the smtpserver from smtp.outlook.com to smtp-mail.outlook.com web.config settings <mailSettings> <smtp deliveryMethod="Network" from="[email protected]"> <network host="smtp-mail.outlook.com" userName="[email protected]" password="passwordhere" port="587" enableSsl="true"/> </smtp> </mailSettings> ...

Custom drawing using System.Windows.Forms.BorderStyle?

c#,.net,vb.net,winforms,custom-controls

If you want to get results that reliably look like the BorderStyles on the machine you should make use of the methods of the ControlPaint object. For testing let's do it ouside of a Paint event: Panel somePanel = panel1; using (Graphics G = somePanel.CreateGraphics()) { G.FillRectangle(SystemBrushes.Window, new Rectangle(11, 11,...

Gridview items not populating correctly

asp.net,vb.net

Try this vb code behind, then comment out my test Private Sub BindGrid() Dim dt_SQL_Results As New DataTable '' Commenting out to use test data as I have no access to your database 'Dim da As SqlClient.SqlDataAdapter 'Dim strSQL2 As String 'Dim Response As String = "" 'strSQL2 = "SELECT...

Error when building an XDocument

c#,xml,linq,xpath,linq-to-xml

You can ignore pretty much all your code, the issue is just this: XDocument people = new XDocument("Persons"); You can't create an XDocument containing a string, you need to add an element: XDocument people = new XDocument( new XElement("Persons", original.XPathSelectElements(xpathFilterDups))); ...

group siblings by identifying the first node of a certain type in sequence

xml,xslt,xpath

Try it this way: <xsl:key name="kFirstText" match="*[not(self::type1[not(preceding-sibling::*[1][self::type1])])]" use="generate-id(preceding-sibling::type1[not(preceding-sibling::*[1][self::type1])][1])"/> This excludes the "leader" nodes from the group retrieved by the key....

C# XML: System.InvalidOperationException

c#,xml

Is "User Info" and "Course Data" is a different entity. If it is so, I think you may encapsulate them in one entity. XmlTextWriter writer = new XmlTextWriter(path, System.Text.Encoding.UTF8); writer.WriteStartDocument(true); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.WriteStartElement("My Entity"); /* It is a biggest one*/ writer.WriteStartElement("User Info"); writer.WriteStartElement("Name"); writer.WriteString(userName); writer.WriteEndElement(); writer.WriteStartElement("Tutor...

Load XML to list using LINQ [duplicate]

c#,xml,linq

Make a base class which will have id,x,y,z, and have Vendors,Bankers and Hospitals extend it. Then you can have a collection of the base class, and add to it the classes that inherit from it....

HTMLPurifier without XML declaration

php,xml,htmlpurifier

you need cut result string $n = strlen('<?xml encoding="utf-8" ?>'); $content_text_fixHTML = substr($H->purify($content_text), $n); ...

Return index of word in string

arrays,vb.net,vbscript

Looking at your desired output it seems you want to get the index of word in your string. You can do this by splitting the string to array and then finding the item in an array using method Array.FindIndex: Dim animals = "cat, dog, bird" ' Split string to array...

Collect strings after a foreach loop

c#,xml,foreach

Yep, you need to do the adding within the loop. I'd use a List<string> as it supports LINQ: XmlNodeList skillNameNodeList=SkillXML.GetElementsByTagName("name"); List<string> skills = new List<string>(); foreach (XmlNode skillNameNode in skillNameNodeList) { skills.Add(skillNameNode.Attributes["value"].Value); } ...

XSLT How to remove style from div and td tags

xml,xslt

To remove some nodes start with the identity transformation template <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> then add an empty template for the nodes to be removed: <xsl:template xmlns:xhtml="http://www.w3.org/1999/xhtml" match="xhtml:div/@style | xhtml:li/@style | xhtml:td/@style | xhtml:span/@style"/> ...

Get XML node value when previous node value conditions are true (without looping)

xml,vb.net,linq-to-xml

UPDATE Using an XDocument vs an XmlDocument, I believe this does what you're asking without using loops. This is dependent on the elements being in the order of <PhoneType> <PhonePrimaryYN> <PhoneNumber> string xml = "<?xml version=\"1.0\"?>" + "<Root>" + " <PhoneType dataType=\"string\">" + " <Value>CELL</Value>" + " </PhoneType>" + "...

XML-XSLT-XPATH : How to convert multiple XML elements to a string, separated by semicolon

xml,xslt,xpath,xslt-2.0

you could use something like: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:text>UserNames: &quot;</xsl:text> <xsl:value-of select="/Users/user/username" separator=";"/> <xsl:text>&quot;&#xA;</xsl:text> <xsl:text>Names: &quot;</xsl:text> <xsl:value-of select="/Users/user/name" separator=";"/>...

Convert contents of an XmlNodeList to a new XmlDocument without looping

c#,xml,xpath,xmldocument,xmlnodelist

If you're happy to convert it into LINQ to XML, it's really simple: XDocument original = ...; // However you load the original document // Separated out for clarity - could be inlined, of course string xpath = "//Person[not(PersonID = following::Person/PersonID)]" XDocument people = new XDocument( new XElement("Persons", original.XPathSelectElements(xpath) )...

Convert Double from String

asp.net,vb.net,visual-studio-2012,converter

The result isn't wrong, it only has lower precision than you expected. Floating point numbers have a limited precision by design, and you simply can't expect to get a result that is more precise than its limit. You can use a Decimal to get higher precision. In this case it...

how can i use parameters to avoid sql attacks

sql,vb.net

I think the only solution is create a new function and gradually migrate to it. Public Function ExecuteQueryReturnDS(ByVal cmdQuery As SqlCommand) As DataSet Try Dim ds As New DataSet Using sqlCon As New SqlConnection(connStr) cmdQuery.Connection = sqlCon Dim sqlAda As New SqlDataAdapter(cmdQuery) sqlAda.Fill(ds) End Using Return ds Catch ex As...

Can't output Guid Hashcode

sql,vb.net,guid,hashcode

Well, are you looking for a hashcode like this? "OZVV5TpP4U6wJthaCORZEQ" Then this answer might be useful: Guid g = Guid.NewGuid(); string GuidString = Convert.ToBase64String(g.ToByteArray()); GuidString = GuidString.Replace("=",""); GuidString = GuidString.Replace("+",""); Extracted from here. On the linked post there are many other useful answers. Please take a look! Other useful links:...

Ruby- get a xml node value

ruby,xml

Try to use css instead of xpath, this will work for you, doc = Nokogiri::XML(response.body) values = doc.css('Name').select{|name| name.text}.join',' puts values => Ram,Sam ...

How to extract efficientely content from an xml with python?

python,xml,python-2.7,pandas,lxml

There are several things wrong here. (Asking questions on selecting a library is against the rules here, so I'm ignoring that part of the question). You need to pass in a file handle, not a file name. That is: y = BeautifulSoup(open(x)) You need to tell BeautifulSoup that it's dealing...

finding file in root of wpf application

c#,xml,wpf,visual-studio,relative-path

First, ensure that the file is definitely copied into your output ./bin/ directory on compile: This worked perfectly for me in my WPF application: const string imagePath = @"pack://application:,,,/Test.txt"; StreamResourceInfo imageInfo = Application.GetResourceStream(new Uri(imagePath)); byte[] imageBytes = ReadFully(imageInfo.Stream); If you want to read it as binary (e.g. read an image...

type conversion performance optimizable?

c#,xml,csv,optimization,type-conversion

IEnumerable<string> values = new List<string>(); values = … Probably not going to be a big deal, but why create a new List<string>() just to throw it away. Replace this with either: IEnumerable<string> values; values = … If you need values defined in a previous scope, or else just: Enumerable<string> values...

How to pass all value of ListBox Control to a function?

vb.net,listbox

You're passing the contents of a ListBox to a method that is just displaying them in a MsgBox(). There are two approaches you can do to accomplish what I think you're wanting. You can pass ListBox.Items to the method and iterate through each item concatenating them into a single String...

About sorting based on the counting of subelements

xml,xslt

You can use a key in order to count the properties in the sort instruction. A stylesheet containing the following: <xsl:key name="p" match="property" use="@agency"/> <xsl:template match="/immo"> <result> <xsl:for-each select="agency"> <xsl:sort select="count(key('p', @name))"/> <res id="{ @name }" count="{ count(key('p', @name)) }"/> </xsl:for-each> </result> </xsl:template> when applied to the following input: <immo>...

Multiply arrays by arrays in JAVA

java,arrays,xml,permutation

Something like this? import java.util.ArrayList; import java.util.Collections; import java.util.List; public class MatrixCross { public static void cross(String[]... matrix){ cross(0,matrix, Collections.EMPTY_LIST); } private static void cross(int index,String[][] matrix, List<String> result){ if (index >= matrix.length){ System.out.println("<test>"); int i = 1; for (String str : result) { System.out.println(" <test_"+i+">"+str+"</test_"+i+">"); i++; } System.out.println("</test>"); }...

xpath query seem to be failing

xml,xpath

$str = '<root><Pages> <copyright>me inc. 2015,</copyright> <author>Me</author> <lastUpdate>2/1/1999</lastUpdate> <Home>--------------------</Home> <About>--------------------</About> <Contact>------------------</Contact> </Pages></root>'; $xml = simplexml_load_string($str); $result = $xml->xpath('//Pages/*[(name() = "Home") or following-sibling::Home]'); if ($result === false) { $this->parseError(); //To return xml Error code...

Extracting XML data from CLOB

sql,xml,oracle

Use xmltable. Data setup: create table myt( col1 clob ); insert into myt values('<ServiceDetails> <FoodItemDetails> <FoodItem FoodItemID="6486" FoodItemName="CARROT" Quantity="2" Comments="" ServingQuantityID="142" ServingQuantityName="SMALL GLASS" FoodItemPrice="50" ItemDishPriceID="5336" CurrencyName="INR" CurrencyId="43"/> </FoodItemDetails> <BillOption> <BillDetails TotalPrice="22222" BillOption="cash"/> </BillOption> <Authoritativeness/> </ServiceDetails>' ); commit; Query:...

Visual Basic Datagrid View change row colour

vb.net,datagridview,datagrid

Is it possible that your datagridview isn't loaded fully when you try to recolor the rows? Since you are setting the datasource, you should put your code that affects the grid after you can make sure that it is finished loading. The column widths change because it is not dependent...

Comparing arrays with numbers in vb.net

arrays,vb.net

There are a few basic ways of checking for a value in an integer array. The first is to manually search by looping through each value in the array, which may be what you want if you need to do complicated comparisons. Second is the .Contains() method. It is simpler...

Connecting to database using Windows Athentication

sql-server,vb.net,authentication,connection-string

You need to add Integrated Security=SSPI and remove username and password from the connection string. Dim ConnectionString As String = "Data Source=Server;Initial Catalog=m2mdata02;Integrated Security=SSPI;" ...

Set Label From Thread

vb.net,multithreading,winforms

The reason is that you are referring to the default instance in your second code snippet. Default instances are thread-specific so that second code snippet will create a new instance of the Form1 type rather then use the existing instance. Your Class1 needs a reference to the original instance of...

XSL transformation outputting multiple times and other confusion

xml,xslt,xpath

1) Your template is applied to 3 elements, and for each of them, loops over all the parents li elements (yes, for each of them, ask all the li elements, children of the grand-father of the current content, which are all the 3 li elements, each time). 2) Because that's...

Unable to construct Document object from xml string

java,xml,xpath,xml-parsing

As Arthur Elrich pointed out in the comments, you should make the factory namespace aware and provide a namespace context to the XPath instance. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse( new InputSource(new StringReader(...))); XPath xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(new MyNamespaceContext()); String s = xpath.evaluate("//location:address/text()",...

Retrieve full path of FTP file on drag & drop?

vb.net,ftp

If the data dropped contains a UniformResourceLocator format, you can get the entire URL from that, for example: Private Sub Form1_DragDrop(sender As Object, e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop If e.Data.GetDataPresent("UniformResourceLocator") Then Dim URL As String = New IO.StreamReader(CType(e.Data.GetData("UniformResourceLocator"), IO.MemoryStream)).ReadToEnd End If End Sub It first checks to see if a...

XSLT for-each statement not iterating proper amount of times

xml,xslt

Try it this way? <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/template/L"> <html> <body> <ul> <xsl:for-each select="Q"> <li> <xsl:value-of select="text()"/> <ul> <xsl:for-each select="R"> <li> <xsl:value-of select="."/> </li> </xsl:for-each> </ul> </li> </xsl:for-each> </ul> </body> </html> </xsl:template> </xsl:stylesheet> Explanation: When...

XML Schema 1.0 “All” with multiple same elements?

xml,schema

You're blocked by a non-orthogonality of XML Schema. You'd think that the following should work: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="top"> <xs:complexType> <xs:sequence> <xs:all> <xs:element name="A" minOccurs="0"/> <xs:element name="B" minOccurs="0"/> <xs:element name="C" minOccurs="0"/> <xs:element name="D" minOccurs="0"/> </xs:all> <xs:element name="E" minOccurs="1"...

Removing Alert When Using DeleteFile API

vb.net,vba,api,delete

There are several SHFILEOPSTRUCT.fFlags options you'll want to consider. You are asking for FOF_NOCONFIRMATION, &H10. You probably want some more, like FOF_ALLOWUNDO, FOF_SILENT, FOF_NOERRORUI, it isn't clear from the question. Check the docs.

XElement.Value is stripping XML tags from content

c#,.net,xml,xml-parsing,xelement

As others have said, this format is truly horrible, and will break as soon as the XML embedded in the JSON will contain double quotes (because in the JSON they will be encoded as \", which will make the XML invalid). The JSON should really be embedded as CDATA. Now,...

Sequence number for static and dynamic rows in XSLT 2.0

xml,xslt-2.0

Would this XSLT do: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" /> <xsl:strip-space elements="*"/> <xsl:template match="/*"> <xsl:apply-templates select=".//line"/> </xsl:template> <xsl:template match="line"> <xsl:variable name="pos" select="position() + (3 * count(preceding::data))"/> <xsl:value-of select="concat(format-number($pos, '00000 '), ., '&#xa;')"/> </xsl:template> <xsl:template...

XMLPullParser black diamond question marks with certain characters

android,xml,character-encoding,xmlpullparser,questionmark

Content encoding and character encoding are not the same thing. Content encoding refers to compression such as gzip. Since getContentEncoding() is null, that tells you there's no compression. You should be looking at conn.getContentType(), because the character encoding can usually be found in the content-type response header. conn.getContentType() might return...

How to calculate max string-length of a node-set?

xml,xslt,xslt-1.0,libxslt

<xsl:variable name="max_a_width"> <xsl:for-each select="data"> <xsl:sort select="string-length(@a)" data-type="number" /> <xsl:if test="position() = last()"> <xsl:value-of select="string-length(@a)" /> </xsl:if> </xsl:for-each> </xsl:variable> This is the general method of picking from an ordered list of derived values in XSLT 1.0. If you want to pick the minimum/maximum from actual (natively sortable) values, you can take...

Fixed element in android?

android,xml,android-fragments

You need a FrameLayout. In a FrameLayout, the children are overlapped on top of each other with the last child being at the topmost. activity_main.xml <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fab="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"...

NullReference Error while assiging values of Modeltype in MVC View (Razor)

vb.net,razor,model-view-controller,model

You need to pass the model instance to the view: Function Details() As ActionResult Dim employee As Employee employee = New Employee employee.EmployeeID = 101 Return View(employee) End Function ...

List view not returning to original state after clearing search

java,android,xml,android-activity,android-listfragment

You are operating on the original data instead of filtered data. You should maintain a reference to original data and use the filtered data for all other purposes. So that the original data is displayed when search is cleared. Replace all usages of mData with mFilteredData as below and only...

ZipEntry() and converting persian filenames

vb.net,persian,sharpziplib

Try setting IsUnicodeText to true: 'VB.NET Dim newEntry = New ZipEntry(entryName) With { _ Key .DateTime = DateTime.Now, _ Key .Size = size, _ Key .IsUnicodeText = True _ } //C# var newEntry = new ZipEntry(entryName) { DateTime = DateTime.Now, Size = size, IsUnicodeText = true }; ...